veh command help - 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 command help (
/showthread.php?tid=266869)
veh command help -
[MKD]Max - 06.07.2011
I Need to put something in this command that is make old car delete and spawn new car help!
Код:
if(strcmp(cmd, "/veh", true) == 0 && PlayerAdminLevel[playerid] >= 1)
{
new car;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /veh (vehid)");
return 1;
}
if(!IsNumeric(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /veh (vehid) ID Must be a number");
return 1;
}
car = strval(tmp);
if(car < 400 || car > 611) {
SendClientMessage(playerid, COLOR_ERROR, "Car ID Cant Be Less Than 400 And More Than 611");
return 1;
}
if(IsPlayerInAnyVehicle(playerid)){
SendClientMessage(playerid,COLOR_ERROR,"You Already Got Car");
return 1;
}
new Float:x, Float:y, Float:z, Float:Angle;
new s[128];
GetPlayerPos(playerid, x,y,z);
acar = CreateVehicle(car, x+3,y,z, Angle, 1, 1, 60000);
new pname[24];
new uname[24];
GetPlayerName(playerid,uname,24);
GetPlayerName(giveplayerid,pname,24);
GetPlayerFacingAngle(playerid,Angle);
format(string,sizeof(string), "You Have Spawned Car %d ",car);
SendClientMessage(playerid,COLOR_GREEN,string);
format(s,sizeof(s),"Server %s %s(%d) Has Spawned %d Car",AdminRanks[PlayerAdminLevel[playerid]],uname,playerid,car);
SaveToFile("car",s);
return 1;
}
Re: veh command help -
willsuckformoney - 06.07.2011
pawn Код:
if(strcmp(cmd, "/veh", true) == 0 && PlayerAdminLevel[playerid] >= 1)
{
new car;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /veh (vehid)");
return 1;
}
if(!IsNumeric(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /veh (vehid) ID Must be a number");
return 1;
}
car = strval(tmp);
if(car < 400 || car > 611) {
SendClientMessage(playerid, COLOR_ERROR, "Car ID Cant Be Less Than 400 And More Than 611");
return 1;
}
if(IsPlayerInAnyVehicle(playerid)){
SendClientMessage(playerid,COLOR_ERROR,"You Already Got Car");
return 1;
}
new Float:x, Float:y, Float:z, Float:Angle;
new s[128];
GetPlayerPos(playerid, x,y,z);
DestroyVehicle(acar);
acar = CreateVehicle(car, x+3,y,z, Angle, 1, 1, 60000);
new pname[24];
new uname[24];
GetPlayerName(playerid,uname,24);
GetPlayerName(giveplayerid,pname,24);
GetPlayerFacingAngle(playerid,Angle);
format(string,sizeof(string), "You Have Spawned Car %d ",car);
SendClientMessage(playerid,COLOR_GREEN,string);
format(s,sizeof(s),"Server %s %s(%d) Has Spawned %d Car",AdminRanks[PlayerAdminLevel[playerid]],uname,playerid,car);
SaveToFile("car",s);
return 1;
}
Try it.