Carspawning
#2

You should stick to your old topic...
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;
}
That should work
Reply


Messages In This Thread
Carspawning - by RedFusion - 19.11.2009, 11:46
Re: Carspawning - by LarzI - 19.11.2009, 13:23
Re: Carspawning - by RedFusion - 19.11.2009, 14:03
Re: Carspawning - by LarzI - 19.11.2009, 14:23
Re: Carspawning - by RedFusion - 19.11.2009, 14:27
Re: Carspawning - by LarzI - 19.11.2009, 14:38
Re: Carspawning - by RedFusion - 19.11.2009, 14:50
Re: Carspawning - by RedFusion - 19.11.2009, 18:58

Forum Jump:


Users browsing this thread: 2 Guest(s)