Command problem - 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)
+--- Thread: Command problem (
/showthread.php?tid=405251)
Command problem -
TuTh - 05.01.2013
I wanna make a command for leaders where the leader can respawn the faction cars, but don't work
Код:
}
if(strcmp(cmd, "/respawnfactioncars", true) == 0 || strcmp(cmd, "/rfc", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new unwanted[MAX_VEHICLES];
if(PlayerInfo[playerid][pLeader] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, " Only leaders can use that command!");
return 1;
}
if(PlayerInfo[playerid][pLeader] == 1)
{
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=1; }
}
for(new c=0;c<MAX_VEHICLES;c++)
{
if(unwanted[c] != 1)
{
SetVehicleToRespawn(IsAPoliceCar©);
}
}
SendClientMessage(playerid, COLOR_GREY, " Vehicles Respawned !");
}
}
return 1;
}
Код:
public IsAPoliceCar(carid)
{
if((carid >= 147) && (carid <= 152) || (carid >= 41) && (carid <= 43) || carid == 36 || carid == 37 || carid == 41 || carid == 42 || carid == 43 || carid == 47 || carid == 48 || carid == 49 || carid == 50 || carid == 51 || carid == 54 || carid == 56 || carid == 57 || carid == 58 || carid == 60)
{
return 1;
}
return 0;
}
Re : Command problem -
TuTh - 06.01.2013
uppp
Re: Command problem -
Jimmy0wns - 06.01.2013
Dont dubble post,
anyways, did you got any errors while compiled it??
Re: Command problem -
Dark Killer - 06.01.2013
Код:
if (strcmp("/respawnfactioncars", cmdtext, true, 18) == 0)
try like this maybe this will help :P
Re : Command problem -
TuTh - 06.01.2013
.. i don't have errors but the command don't work
Re: Command problem -
eesh - 06.01.2013
Make this change
Код:
for(new c=0;c<MAX_VEHICLES;c++)
{
if(unwanted[c] != 1 && IsAPoliceCar© == 1)
{
SetVehicleToRespawn©;
}
}