[HELP] Respawncars Command
#1

Hello!

I have these errors:

pawn Код:
C:\Users\user\Desktop\drift\filterscripts\ladmin4.pwn(4998) : error 017: undefined symbol "IsVehicleOccupied"
C:\Users\user\Desktop\drift\filterscripts\ladmin4.pwn(5003) : error 017: undefined symbol "GetPlayerNameEx"
With this!

pawn Код:
if(strcmp(cmd, "/respawncars", true) == 0)
    {
        if(PlayerInfo[playerid][Level] >= 4)
        {
            for(new i=0;i<MAX_VEHICLES;i++)
            {
                if(IsVehicleOccupied(i) == 0)
                {
                    SetVehicleToRespawn(i);
                }
            }
            format(string, sizeof(string), "ATTENTION: Unoccupied vehicles respawned by %s.", GetPlayerNameEx(playerid));
            SendClientMessageToAll(blue, string);
        }
        else
        {
            SendClientMessage(playerid, red, "ERROR: You are not an administrator!");
        }
        return 1;
    }
Can enyone help me out please?


Thank You!
Reply
#2

pawn Код:
stock IsVehicleOccupied(vehicleid)
{
  for(new i = 0; i < MAX_PLAYERS; i++) {
    if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER) return 1;
  }
  return 0;
}

stock GetPlayerNameEx(playerid)
{
     new Name[24];
     GetPlayerName(playerid,Name,24);
     return Name;
}
Reply
#3

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
pawn Код:
stock IsVehicleOccupied(vehicleid)
{
  for(new i = 0; i < MAX_PLAYERS; i++) {
    if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER) return 1;
  }
  return 0;
}

stock GetPlayerNameEx(playerid)
{
     new Name[24];
     GetPlayerName(playerid,Name,24);
     return Name;
}
Now it works, thank you! +rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)