Posts: 17
Threads: 3
Joined: May 2011
Reputation:
0
Hey, I really need some help, i'm looking for a little script, so say if someone does, /vx (vehiclename) it will spawn them in the car,I'm typically new to scripting so i really need some help, i've attempted it but i can't do it, can someone put on a script for this command? Please. Thanks.
Posts: 17
Threads: 3
Joined: May 2011
Reputation:
0
ive tried and tried, i just cant fine it :/
Posts: 1,297
Threads: 17
Joined: Apr 2011
pawn Код:
if(strcmp( cmd, "/vx", true ) == 0 )
{
new Float:X, Float:Y, Float:Z;
new tmp[256];
new created_vehicle_id;
tmp = strtok( cmdtext, idx );
GetPlayerPos( playerid, X, Y, Z );
created_vehicle_id = CreateVehicle( strval(tmp), X+2, Y+2, Z, 0, 0, 0, -1 );
new msg[256];
format(msg,256,"Created vehicle: %d",created_vehicle_id);
SendClientMessage(playerid,0xAAAAAAAA,msg);
return 1;
}
Posts: 1,297
Threads: 17
Joined: Apr 2011
Or maybe use zcmd processor.
Posts: 17
Threads: 3
Joined: May 2011
Reputation:
0
C:\Users\Serenity\Desktop\MMM.pwn(2644) : error 017: undefined symbol "cmd"
C:\Users\Serenity\Desktop\MMM.pwn(2649) : error 017: undefined symbol "strtok"
C:\Users\Serenity\Desktop\MMM.pwn(2649) : error 033: array must be indexed (variable "tmp")
:S
Posts: 328
Threads: 19
Joined: May 2011
Reputation:
0
@ Tinsler, your welcome
@Naruto_Emilio, doesn't matter which way of command detect he will use. It'll cause (should) crash or lag if he write /vx blablablablabal.
You've to do something to avoid it, e.g.
new CarNames[]{"Turismo","Tahoma",...}; and lots more.
~Lets