09.10.2013, 17:01
Se For em Strcmp:
Em ZCMD:
pawn Код:
if(strcmp(cmd, "/RespawnCars", true) == 0)
{
new string[528];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, CINZA, "Somente Administrador");
SendClientMessageToAll(0x00FF00FF, string);
new bool:vehicle[MAX_VEHICLES];
for(new j = 1; GetVehicleModel(j); ++j)
{
vehicle[j] = false;
for(new i, p = GetMaxPlayers(); i < p; ++i)
{
if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i)) continue;
if(IsPlayerInVehicle(i, j))
{
vehicle[j] = true;
break;
}
}
if(!vehicle[j]) SetVehicleToRespawn(j);
}
return 1;
}
pawn Код:
CMD:respawncars(playerid)
{
new string[528];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, CINZA, "Somente Administrador");
SendClientMessageToAll(0x00FF00FF, string);
new bool:vehicle[MAX_VEHICLES];
for(new j = 1; GetVehicleModel(j); ++j)
{
vehicle[j] = false;
for(new i, p = GetMaxPlayers(); i < p; ++i)
{
if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i)) continue;
if(IsPlayerInVehicle(i, j))
{
vehicle[j] = true;
break;
}
}
if(!vehicle[j]) SetVehicleToRespawn(j);
}
return 1;
}