Jump to content

[HLADAM] Spawnutie auta


Mafian

Recommended Posts

Hladám príkaz , ktorý spawne auto Elegy.Malo by to byť na príkaz /elegy. Ale tak aby každý hráč mohol mať iba jedno vytvorené auto. Keď si bude chceť druhý krát spawnuť auto tak to prvé by sa zmazalo.

Link to comment
Share on other sites

nic jako setvehicle neexistuje

 

chce to proměnnou s polem (pro každého hráče) a při vytvoření dáš té proměnné hodnotu spawntého auta (CreateVehicle vrací ID auta) a pak ho jednoduše smažeš přes DestroyVehicle

Link to comment
Share on other sites

nic jako setvehicle neexistuje

 

chce to proměnnou s polem (pro každého hráče) a při vytvoření dáš té proměnné hodnotu spawntého auta (CreateVehicle vrací ID auta) a pak ho jednoduše smažeš přes DestroyVehicle

 

 

Vedel by si to spraviť? Ja sa do pawna moc neviznam

Link to comment
Share on other sites

new bool:elegy[MAX_PLAYERS];
new auto[MAX_PLAYERS];

dcmd(elegy, 5, cmdtext);

dcmd_elegy(playerid, params[])
{
#pragma unused params
if(elegy[playerid] == true) return SendClientMessage(playerid, 0xFFFFFFAA, "Uz mas auto.");
else
{
new Float: X, Float: Y, Float: Z;
GetPlayerPos(playerid, X, Y, Z);
auto[playerid] = CreateVehicle(IDElegy, X, Y, Z, 0, random(126), random(126), 0);
PutPlayerInVehicle(playerid, auto[playerid], 0);
elegy = true;
}
return 1;
}

do OnVehicleDeath

if(vehicleid == auto[playerid])
{
if(elegy[playerid] == true)
{
DestroyVehicle(auto[playerid]);
elegy[playerid] = false;
}
}

Link to comment
Share on other sites

new bool

:elegy[MAX_PLAYERS];

 

dcmd(elegy, 5, cmdtext);

 

dcmd_elegy(playerid, params[])

{

#pragma unused params

if(elegy[playerid] == true) return SendClientMessage(playerid, 0xFFFFFFAA, "Uz mas auto.");

else

{

new Float: X, Float: Y, Float: Z, auto;

GetPlayerPos(playerid, X, Y, Z);

auto = CreateVehicle(IDElegy, X, Y, Z, 0, random(126), random(126), 0);

PutPlayerInVehicle(playerid, auto, 0);

}

return 1;

}

 

Link to comment
Share on other sites

 

C:\Documents and Settings\Robo\Plocha\bd.pwn(1287) : error 017: undefined symbol "dcmd"

 

v

 

dcmd(elegy, 5, cmdtext);

 

 

 

C:\Documents and Settings\Robo\Plocha\bd.pwn(2582) : error 010: invalid function or declaration

C:\Documents and Settings\Robo\Plocha\bd.pwn(2584) : error 010: invalid function or declaration

C:\Documents and Settings\Robo\Plocha\bd.pwn(2586) : error 010: invalid function or declaration

C:\Documents and Settings\Robo\Plocha\bd.pwn(2588) : error 021: symbol already defined: "__DestroyVehicle"

 

v

do OnVehicleDeath

 

if(vehicleid == auto[playerid])

{

if(elegy[playerid] == true)

{

DestroyVehicle(auto[playerid]);

elegy[playerid] = false;

}

}

 

Link to comment
Share on other sites

C:\Documents and Settings\Robo\Plocha\bd.pwn(1287) : error 017: undefined symbol "dcmd"

 

v

 

dcmd(elegy, 5, cmdtext);

 

 

Nadefinuj si DCMD hore do FS/GM

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...