[HELP] Respawncars Command - 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: [HELP] Respawncars Command (
/showthread.php?tid=407897)
[HELP] Respawncars Command -
martin3644 - 15.01.2013
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!
Re: [HELP] Respawncars Command -
Dolby - 15.01.2013
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;
}
Re: [HELP] Respawncars Command -
martin3644 - 15.01.2013
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