13.07.2009, 12:39
Hello.
I made a command which will allow faction leader to respawn faction vehicles. When I test command IG it returns me 'SERVER: Unknown Command', but it respawns some of the faction vehicles (not all) and also some random other vehicles.
Here is the script:
What am I doing wrong here?
Thanks for help.
I made a command which will allow faction leader to respawn faction vehicles. When I test command IG it returns me 'SERVER: Unknown Command', but it respawns some of the faction vehicles (not all) and also some random other vehicles.
Here is the script:
pawn Код:
if(strcmp(cmd, "/respawnf", true) == 0)
{
if (PlayerInfo[playerid][pRank] == 1 && PlayerInfo[playerid][pFaction] != 255)
{
for(new i=0;i<MAX_VEHICLES;i++)
{
if(IsVehicleOccupied(i) == 0)
{
if(PlayerInfo[playerid][pFaction] == DynamicCars[i][FactionCar])
{
SetVehicleToRespawn(i);
}
}
}
format(string, sizeof(string), "%s has just respawned faction vehicles.", GetPlayerNameEx(playerid));
SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_LIGHTRED, string);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You are not a leader!");
}
return 1;
}
Thanks for help.