/veh, Spawn Veh cmd - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /veh, Spawn Veh cmd (
/showthread.php?tid=73344)
/veh, Spawn Veh cmd -
Taz86 - 14.04.2009
Hello Does someone have a cmd to spawn cars IG?
I need the code to a normal RP GM, (LARP)
I mean the thing when you type /veh so it will show you: Car ID, Color 1 Color 2
That thing.
I htink all know it.
So please send me him
Re: /veh, Spawn Veh cmd -
MenaceX^ - 14.04.2009
pawn Код:
if(!strcmp(cmd,"/veh",true))
{
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
new car=strval(cmd);
if(!IsValidvehicleModel(strval(cmd))) return SendClientMessage(playerid,COLOR_GREY,"Invalid vehicle ID.");
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
new color1=strval(cmd);
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
new color2=strval(cmd);
GetPlayerPos(playerid,x,y,z);
return CreateVehicle(car,x,y,z,0.0,color1, color2,-1);
}
pawn Код:
IsValidvehicleModel(model) return model>=400&&model<611;
Re: /veh, Spawn Veh cmd -
Taz86 - 14.04.2009
Quote:
Originally Posted by MenaceX^
pawn Код:
if(!strcmp(cmd,"/veh",true)) { cmd=strtok(cmdtext,idx); if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]"); new car=strval(cmd); if(!IsValidvehicleModel(strval(cmd))) return SendClientMessage(playerid,COLOR_GREY,"Invalid vehicle ID."); cmd=strtok(cmdtext,idx); if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]"); new color1=strval(cmd); cmd=strtok(cmdtext,idx); if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]"); new color2=strval(cmd); GetPlayerPos(playerid,x,y,z); return CreateVehicle(car,x,y,z,0.0,color1, color2,-1); }
pawn Код:
IsValidvehicleModel(model) return model>=400&&model<611;
|
Thanks, but where to put: IsValidvehicleModel(model) return model>=400&&model<611; ?
Re: /veh, Spawn Veh cmd -
MenaceX^ - 14.04.2009
Somewhere in your script...
Re: /veh, Spawn Veh cmd -
LarzI - 14.04.2009
no, right after the if statement
pawn Код:
if(!strcmp(cmd,"/veh",true))
{
if(IsValidvehicleModel(model)) return model>=400&&model<611;
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
new car=strval(cmd);
if(!IsValidvehicleModel(strval(cmd))) return SendClientMessage(playerid,COLOR_GREY,"Invalid vehicle ID.");
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
new color1=strval(cmd);
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
new color2=strval(cmd);
GetPlayerPos(playerid,x,y,z);
return CreateVehicle(car,x,y,z,0.0,color1, color2,-1);
}
Re: /veh, Spawn Veh cmd -
Taz86 - 14.04.2009
No need guys, i have my own cmd
Thanks