19.11.2009, 13:23
You should stick to your old topic...
But anyways, as I tried to explain, the var definition should be global, not inside the command...
That should work
But anyways, as I tried to explain, the var definition should be global, not inside the command...
pawn Код:
//Under includes
new pVeh[playerid] = -1;
//function
stock aCreateThing(playerid, thingid, orderid)
{
if(pVeh[playerid] != -1)
DestroyVehicle(pVeh[playerid]);
new Float:X, Float:Y, Float:Z, Float:Angle;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
if(thingid != 597)
{
pVeh[playerid] = CreateVehicle(thingid, X, Y, Z + 3, Angle, random(126), random(126), 30);
}
else
{
pVeh[playerid] = CreateVehicle(thingid, X, Y, Z + 3, Angle, 0, 1, 30);
}
PutPlayerInVehicle(playerid, pVeh[playerid], 0);
TogglePlayerControllable(playerid, true);
return 1;
}