06.06.2014, 20:03
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/respawnall", true))
{
if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You need to be RCON admin to use this command.");
for (new v = 1; v != MAX_VEHICLES; ++v)
{
if (!GetVehicleModel(v)) continue; // vehicle doesn't exist, skip it..
if (!IsVehicleOccupied(v)) SetVehicleToRespawn(v); // vehicle is not occupied, respawn it..
}
return 1;
}
return 0;
}
IsVehicleOccupied(vehicleid)
{
foreach(new i : Player)
{
if (IsPlayerInVehicle(i, vehicleid) return 1;
}
return 0;
}
I'm going to say this - you shouldn't be using strcmp for commands but ZCMD or y_commands because they're faster.
Last, getting warnings about loosing indentation does not mean the code is wrong. All you have to do is indent the code properly: https://sampwiki.blast.hk/wiki/Errors_Li...se_indentation