18.05.2010, 20:17
Hello there,
I tried to make a /spawn command,which will spawn you a vehicle.
Well it does spawn you a vehicle,it just doesn't send me the correct Model ID of the vehicle that spawned.
Code:
It always sends : "Created vehicle: 0"
Well please help me if possible.
Thanks in advance.
I tried to make a /spawn command,which will spawn you a vehicle.
Well it does spawn you a vehicle,it just doesn't send me the correct Model ID of the vehicle that spawned.
Code:
pawn Код:
if(strcmp( cmd, "/spawn", true ) == 0 )
{
if(!cmdtext[6])return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /Spawn [MODELID]");
new Float:X, Float:Y, Float:Z;
new tmp[256];
new NameForSpawned;
new Float:a;
tmp = strtok( cmdtext, idx );
GetPlayerPos( playerid, X, Y, Z );
GetPlayerFacingAngle(playerid,a);
CreateVehicle( strval(tmp), X+2, Y+2, Z, a+90, -1, -1, -1 );
NameForSpawned = GetVehicleModel(strval(tmp));
new msg[256];
format(msg,256,"Created vehicle: %d",NameForSpawned);
SendClientMessage(playerid,COLOR_PURPLE,msg);
return 1;
}
Well please help me if possible.
Thanks in advance.