SA-MP Forums Archive
error 017: undefined symbol "PlayerName" - 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: error 017: undefined symbol "PlayerName" (/showthread.php?tid=354661)



error 017: undefined symbol "PlayerName" - shayan122 - 27.06.2012

Somebody Plz Help me with this !

Errors:
Код:
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2304) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2307) : error 017: undefined symbol "ShowLoginScreen"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2310) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2313) : error 017: undefined symbol "ShowRegisterScreen"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2348) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2349) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2350) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2351) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2352) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2353) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2354) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2355) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2356) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2357) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2358) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2359) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2360) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2361) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2362) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2363) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2367) : error 004: function "ResetVariables" is not implemented
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2399) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2573) : error 017: undefined symbol "StopLoopingAnim"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2579) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2582) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2731) : error 017: undefined symbol "PlayerName"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Lines:


Код:
	//Check to see if they are registered or logged in
	if(udb_Exists(PlayerName(playerid)))
	{
		SendClientMessage(playerid,COLOR_ERROR,"This player name has already been registered. Please login before you spawn.");
		ShowLoginScreen(playerid);
	}
	else
	if(!udb_Exists(PlayerName(playerid)))
	{
		SendClientMessage(playerid,COLOR_ERROR,"This player name has not been registered. You must register before playing.");
		ShowRegisterScreen(playerid);
	}

	for(new i = 0; i < sizeof(Objects); i++) Player[playerid][view][i] = false; /////////xobj
	
	return 1;
}

//==============================================================================

public OnPlayerDisconnect(playerid, reason)
{
	if(IsPlayerNPC(playerid))
	{
	    IsSpawned[playerid] =0;
	    return 1;
	}
    if(afktag[playerid] == 1)
	{
		new pname[16];
		GetPlayerName(playerid,pname,16);
		strdel(pname, strlen(pname)-5, strlen(pname));
		afktag[playerid] =0;
		SetPlayerName(playerid,pname);
	}
    new string[128];
	new pname[24];
	GetPlayerName(playerid,pname,sizeof(pname));
	
	//Save Wanted Level && Jailtime
	SavedWantedLevel[playerid] =GetPlayerWantedLevel(playerid);
	SavedJailTime[playerid] =JailTime[playerid];
	
	if(PLAYERLIST_authed[playerid] == 1)
	{
		dUserSetINT(PlayerName(playerid)).("Bankcash",BankCash[playerid]);
		dUserSetINT(PlayerName(playerid)).("Cash",GetPlayerMoney(playerid));
		dUserSetINT(PlayerName(playerid)).("Score",GetPlayerScore(playerid));
	 	dUserSetINT(PlayerName(playerid)).("Adminlevel",AdminLevel[playerid]);
		dUserSetINT(PlayerName(playerid)).("Army",CanUseArmy[playerid]);
		dUserSetINT(PlayerName(playerid)).("CIA",CanUseCIA[playerid]);
		dUserSetINT(PlayerName(playerid)).("RegularPlayer",IsRegularPlayer[playerid]);
		dUserSetINT(PlayerName(playerid)).("DrugHouseOwner",DrugHouseOwner[playerid]);
		dUserSetINT(PlayerName(playerid)).("OttoOwner",OttoOwner[playerid]);
		dUserSetINT(PlayerName(playerid)).("TSkill",TerroristSkill[playerid]);
		dUserSetINT(PlayerName(playerid)).("RobSkill",RobSkill[playerid]);
		dUserSetINT(PlayerName(playerid)).("HasPackC4",HasPackC4[playerid]);
		dUserSetINT(PlayerName(playerid)).("HasPackRope",HasPackRope[playerid]);
		dUserSetINT(PlayerName(playerid)).("HasPackMoney",HasPackMoney[playerid]);
		dUserSetINT(PlayerName(playerid)).("SavedWantedLevel",SavedWantedLevel[playerid]);
		dUserSetINT(PlayerName(playerid)).("SavedJailTime",SavedJailTime[playerid]);
	}
	
	//Do things to the playerid
	ResetVariables(playerid);
	TextDrawHideForPlayer(playerid,VersionTD);
	TextDrawHideForPlayer(playerid,WebsiteTD);
	TextDrawDestroy(MessageTD[playerid]);
	TextDrawDestroy(JailTimer[playerid]);
	TextDrawDestroy(LocationTD[playerid]);
	
	if (PlayerInfo[playerid][pRoadblock] != 0)
	{
		RemoveRoadblock(playerid);
	}
	for(new i = 0; i < sizeof(Objects); i++) ////Xobj
	{
		if(Player[playerid][view][i])
		{
			Player[playerid][view][i] = false;
			DestroyPlayerObject(playerid,Player[playerid][objid][i]);
		}
	}
	format(string,sizeof(string),"%s Has just left the server! (%s)",pname,aDisconnectNames[reason]);
	SendClientMessageToAll(COLOR_VIOLETBLUE,string);
	format(string,sizeof(string),"1%s Has just left the server! (%s)",pname,aDisconnectNames[reason]);
	IRC_Say(gGroupID,IRC_CHANNEL,string);
	return 1;
}

//==============================================================================

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
	{
		if(strcmp(PlayerName(playerid), "Billy") == 0)
		{
		    PutPlayerInVehicle(playerid,NPCTram,0);
		    SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
		    SetPlayerSkin(playerid,255);
		    IsSpawned[playerid] =1;
		    print("[NPC SPAWN] Billy has been placed in his tram.");
		}
		return 1;
	}



Re: error 017: undefined symbol "PlayerName" - Strech - 27.06.2012

//Check to see if they are registered or logged in
if(udb_Exists(playerid))
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has already been registered. Please login before you spawn.");
ShowLoginScreen(playerid);
}
else
if(!udb_Exists(PlayerName(playerid)))
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has not been registered. You must register before playing.");
ShowRegisterScreen(playerid);
}

for(new i = 0; i < sizeof(Objects); i++) Player[playerid][view][i] = false; /////////xobj

return 1;
}

//================================================== ============================

public OnPlayerDisconnect(playerid, reason)
{
if(IsPlayerNPC(playerid))
{
IsSpawned[playerid] =0;
return 1;
}
if(afktag[playerid] == 1)
{
new pname[16];
GetPlayerName(playerid,pname,16);
strdel(pname, strlen(pname)-5, strlen(pname));
afktag[playerid] =0;
SetPlayerName(playerid,pname);
}
new string[128];
new pname[24];
GetPlayerNameEx(playerid,pname,sizeof(pname));

//Save Wanted Level && Jailtime
SavedWantedLevel[playerid] =GetPlayerWantedLevel(playerid);
SavedJailTime[playerid] =JailTime[playerid];

if(PLAYERLIST_authed[playerid] == 1)
{
dUserSetINT(playerid).("Bankcash",BankCash[playerid]);
dUserSetINT(playerid).("Cash",GetPlayerMoney(playe rid));
dUserSetINT(playerid).("Score",GetPlayerScore(play erid));
dUserSetINT(playerid).("Adminlevel",AdminLevel[playerid]);
dUserSetINT(playerid).("Army",CanUseArmy[playerid]);
dUserSetINT(playerid).("CIA",CanUseCIA[playerid]);
dUserSetINT(playerid).("RegularPlayer",IsRegularPl ayer[playerid]);
dUserSetINT(playerid).("DrugHouseOwner",DrugHouseO wner[playerid]);
dUserSetINT(playerid).("OttoOwner",OttoOwner[playerid]);
dUserSetINT(playerid).("TSkill",TerroristSkill[playerid]);
dUserSetINT(playerid).("RobSkill",RobSkill[playerid]);
dUserSetINT(playerid).("HasPackC4",HasPackC4[playerid]);
dUserSetINT(playerid).("HasPackRope",HasPackRope[playerid]);
dUserSetINT(playerid).("HasPackMoney",HasPackMoney[playerid]);
dUserSetINT(playerid).("SavedWantedLevel",SavedWan tedLevel[playerid]);
dUserSetINT(playerid).("SavedJailTime",SavedJailTi me[playerid]);
}

//Do things to the playerid
ResetVariables(playerid);
TextDrawHideForPlayer(playerid,VersionTD);
TextDrawHideForPlayer(playerid,WebsiteTD);
TextDrawDestroy(MessageTD[playerid]);
TextDrawDestroy(JailTimer[playerid]);
TextDrawDestroy(LocationTD[playerid]);

if (PlayerInfo[playerid][pRoadblock] != 0)
{
RemoveRoadblock(playerid);
}
for(new i = 0; i < sizeof(Objects); i++) ////Xobj
{
if(Player[playerid][view][i])
{
Player[playerid][view][i] = false;
DestroyPlayerObject(playerid,Player[playerid][objid][i]);
}
}
format(string,sizeof(string),"%s Has just left the server! (%s)",pname,aDisconnectNames[reason]);
SendClientMessageToAll(COLOR_VIOLETBLUE,string);
format(string,sizeof(string),"1%s Has just left the server! (%s)",pname,aDisconnectNames[reason]);
IRC_Say(gGroupID,IRC_CHANNEL,string);
return 1;
}

//================================================== ============================

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
if(strcmp(playerid, "Billy") == 0)
{
PutPlayerInVehicle(playerid,NPCTram,0);
SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
SetPlayerSkin(playerid,255);
IsSpawned[playerid] =1;
print("[NPC SPAWN] Billy has been placed in his tram.");
}
return 1;
}




Try this out.I am not sure but try it.


Re: error 017: undefined symbol "PlayerName" - shayan122 - 27.06.2012

i got these than:

Код:
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2304) : error 012: invalid function call, not a valid address
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2304) : warning 215: expression has no effect
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2304) : error 001: expected token: ";", but found ")"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2304) : error 029: invalid expression, assumed zero
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2304) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Код:
	//Check to see if they are registered or logged in
	if(udb_Exists(playerid(playerid))) // 2304 LINE is THIS!
	{
		SendClientMessage(playerid,COLOR_ERROR,"This player name has already been registered. Please login before you spawn.");
		ShowLoginScreen(playerid);
	}
	else
	if(!udb_Exists(playerid(playerid)))
	{
		SendClientMessage(playerid,COLOR_ERROR,"This player name has not been registered. You must register before playing.");
		ShowRegisterScreen(playerid);
	}

	for(new i = 0; i < sizeof(Objects); i++) Player[playerid][view][i] = false; /////////xobj
	
	return 1;
}



Re: error 017: undefined symbol "PlayerName" - Strech - 27.06.2012

//Check to see if they are registered or logged in
if(!udb_Exists(playerid));
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has already been registered. Please login before you spawn.");
ShowLoginScreen(playerid);
}
else
if(!udb_Exists(playerid));
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has not been registered. You must register before playing.");
ShowRegisterScreen(playerid);
}

for(new i = 0; i < sizeof(Objects); i++) Player[playerid][view][i] = false; /////////xobj

return 1;
}

Try this sir.


Re: error 017: undefined symbol "PlayerName" - shayan122 - 27.06.2012

Quote:
Originally Posted by Strech
Посмотреть сообщение
//Check to see if they are registered or logged in
if(udb_Exists(playerid))
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has already been registered. Please login before you spawn.");
ShowLoginScreen(playerid);
}
else
if(!udb_Exists(PlayerName(playerid)))
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has not been registered. You must register before playing.");
ShowRegisterScreen(playerid);
}

for(new i = 0; i < sizeof(Objects); i++) Player[playerid][view][i] = false; /////////xobj

return 1;
}

//================================================== ============================

public OnPlayerDisconnect(playerid, reason)
{
if(IsPlayerNPC(playerid))
{
IsSpawned[playerid] =0;
return 1;
}
if(afktag[playerid] == 1)
{
new pname[16];
GetPlayerName(playerid,pname,16);
strdel(pname, strlen(pname)-5, strlen(pname));
afktag[playerid] =0;
SetPlayerName(playerid,pname);
}
new string[128];
new pname[24];
GetPlayerNameEx(playerid,pname,sizeof(pname));

//Save Wanted Level && Jailtime
SavedWantedLevel[playerid] =GetPlayerWantedLevel(playerid);
SavedJailTime[playerid] =JailTime[playerid];

if(PLAYERLIST_authed[playerid] == 1)
{
dUserSetINT(playerid).("Bankcash",BankCash[playerid]);
dUserSetINT(playerid).("Cash",GetPlayerMoney(playe rid));
dUserSetINT(playerid).("Score",GetPlayerScore(play erid));
dUserSetINT(playerid).("Adminlevel",AdminLevel[playerid]);
dUserSetINT(playerid).("Army",CanUseArmy[playerid]);
dUserSetINT(playerid).("CIA",CanUseCIA[playerid]);
dUserSetINT(playerid).("RegularPlayer",IsRegularPl ayer[playerid]);
dUserSetINT(playerid).("DrugHouseOwner",DrugHouseO wner[playerid]);
dUserSetINT(playerid).("OttoOwner",OttoOwner[playerid]);
dUserSetINT(playerid).("TSkill",TerroristSkill[playerid]);
dUserSetINT(playerid).("RobSkill",RobSkill[playerid]);
dUserSetINT(playerid).("HasPackC4",HasPackC4[playerid]);
dUserSetINT(playerid).("HasPackRope",HasPackRope[playerid]);
dUserSetINT(playerid).("HasPackMoney",HasPackMoney[playerid]);
dUserSetINT(playerid).("SavedWantedLevel",SavedWan tedLevel[playerid]);
dUserSetINT(playerid).("SavedJailTime",SavedJailTi me[playerid]);
}

//Do things to the playerid
ResetVariables(playerid);
TextDrawHideForPlayer(playerid,VersionTD);
TextDrawHideForPlayer(playerid,WebsiteTD);
TextDrawDestroy(MessageTD[playerid]);
TextDrawDestroy(JailTimer[playerid]);
TextDrawDestroy(LocationTD[playerid]);

if (PlayerInfo[playerid][pRoadblock] != 0)
{
RemoveRoadblock(playerid);
}
for(new i = 0; i < sizeof(Objects); i++) ////Xobj
{
if(Player[playerid][view][i])
{
Player[playerid][view][i] = false;
DestroyPlayerObject(playerid,Player[playerid][objid][i]);
}
}
format(string,sizeof(string),"%s Has just left the server! (%s)",pname,aDisconnectNames[reason]);
SendClientMessageToAll(COLOR_VIOLETBLUE,string);
format(string,sizeof(string),"1%s Has just left the server! (%s)",pname,aDisconnectNames[reason]);
IRC_Say(gGroupID,IRC_CHANNEL,string);
return 1;
}

//================================================== ============================

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
if(strcmp(playerid, "Billy") == 0)
{
PutPlayerInVehicle(playerid,NPCTram,0);
SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
SetPlayerSkin(playerid,255);
IsSpawned[playerid] =1;
print("[NPC SPAWN] Billy has been placed in his tram.");
}
return 1;
}




Try this out.I am not sure but try it.
ERRORS:

Код:
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2304) : error 035: argument type mismatch (argument 1)
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2307) : error 017: undefined symbol "ShowLoginScreen"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2310) : error 017: undefined symbol "PlayerName"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2313) : error 017: undefined symbol "ShowRegisterScreen"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2340) : error 017: undefined symbol "GetPlayerNameEx"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2340) : warning 202: number of arguments does not match definition
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2348) : error 035: argument type mismatch (argument 1)
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2349) : error 035: argument type mismatch (argument 1)
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2349) : error 017: undefined symbol "rid"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2349) : error 029: invalid expression, assumed zero
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2349) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.



Re: error 017: undefined symbol "PlayerName" - shayan122 - 27.06.2012

Quote:
Originally Posted by Strech
Посмотреть сообщение
//Check to see if they are registered or logged in
if(!udb_Exists(playerid));
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has already been registered. Please login before you spawn.");
ShowLoginScreen(playerid);
}
else
if(!udb_Exists(playerid));
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has not been registered. You must register before playing.");
ShowRegisterScreen(playerid);
}

for(new i = 0; i < sizeof(Objects); i++) Player[playerid][view][i] = false; /////////xobj

return 1;
}

Try this sir.
lol you edit posts when im posting!
ok... now:
Код:
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2304) : error 035: argument type mismatch (argument 1)
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2304) : error 036: empty statement
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2307) : error 017: undefined symbol "ShowLoginScreen"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2309) : error 029: invalid expression, assumed zero
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2309 -- 2310) : warning 215: expression has no effect
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2310) : error 001: expected token: ";", but found "if"
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2310) : error 035: argument type mismatch (argument 1)
C:\Users\ShayaN\Desktop\SFCNC\gamemodes\SF.pwn(2310) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.



Re: error 017: undefined symbol "PlayerName" - M3mPHi$_S3 - 13.07.2012

try to add
pawn Код:
#include <a_samp>
then try again !!!!


Re: error 017: undefined symbol "PlayerName" - Cxnnor - 13.07.2012

If you haven't already done this make sure you are forwarding it all under OnPlayerDisconnect and you are enumerating it.

pawn Код:
enum pInfo
{
    pName[playerid],
    // etc.
}



Re: error 017: undefined symbol "PlayerName" - clarencecuzz - 13.07.2012

Tell me what errors you get after this:
pawn Код:
#include <a_samp>
//Check to see if they are registered or logged in
public OnPlayerConnect(playerid)
{
if(udb_Exists(PlayerName(playerid))
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has already been registered. Please login before you spawn.");
ShowLoginScreen(playerid);
}
else
if(!udb_Exists(PlayerName(playerid)))
{
SendClientMessage(playerid,COLOR_ERROR,"This player name has not been registered. You must register before playing.");
ShowRegisterScreen(playerid);
}

for(new i = 0; i < sizeof(Objects); i++) Player[playerid][view][i] = false; /////////xobj

return 1;
}

//================================================== ============================

public OnPlayerDisconnect(playerid, reason)
{
if(IsPlayerNPC(playerid))
{
IsSpawned[playerid] =0;
return 1;
}
if(afktag[playerid] == 1)
{
new pname[16];
GetPlayerName(playerid,pname,16);
strdel(pname, strlen(pname)-5, strlen(pname));
afktag[playerid] =0;
SetPlayerName(playerid,pname);
}
new string[128];
new pname[24];
GetPlayerNameEx(playerid,pname,sizeof(pname));

//Save Wanted Level && Jailtime
SavedWantedLevel[playerid] =GetPlayerWantedLevel(playerid);
SavedJailTime[playerid] =JailTime[playerid];

if(PLAYERLIST_authed[playerid] == 1)
{
dUserSetINT(playerid).("Bankcash",BankCash[playerid]);
dUserSetINT(playerid).("Cash",GetPlayerMoney(playe rid));
dUserSetINT(playerid).("Score",GetPlayerScore(play erid));
dUserSetINT(playerid).("Adminlevel",AdminLevel[playerid]);
dUserSetINT(playerid).("Army",CanUseArmy[playerid]);
dUserSetINT(playerid).("CIA",CanUseCIA[playerid]);
dUserSetINT(playerid).("RegularPlayer",IsRegularPl ayer[playerid]);
dUserSetINT(playerid).("DrugHouseOwner",DrugHouseO wner[playerid]);
dUserSetINT(playerid).("OttoOwner",OttoOwner[playerid]);
dUserSetINT(playerid).("TSkill",TerroristSkill[playerid]);
dUserSetINT(playerid).("RobSkill",RobSkill[playerid]);
dUserSetINT(playerid).("HasPackC4",HasPackC4[playerid]);
dUserSetINT(playerid).("HasPackRope",HasPackRope[playerid]);
dUserSetINT(playerid).("HasPackMoney",HasPackMoney[playerid]);
dUserSetINT(playerid).("SavedWantedLevel",SavedWan tedLevel[playerid]);
dUserSetINT(playerid).("SavedJailTime",SavedJailTi me[playerid]);
}

//Do things to the playerid
ResetVariables(playerid);
TextDrawHideForPlayer(playerid,VersionTD);
TextDrawHideForPlayer(playerid,WebsiteTD);
TextDrawDestroy(MessageTD[playerid]);
TextDrawDestroy(JailTimer[playerid]);
TextDrawDestroy(LocationTD[playerid]);

if (PlayerInfo[playerid][pRoadblock] != 0)
{
RemoveRoadblock(playerid);
}
for(new i = 0; i < sizeof(Objects); i++) ////Xobj
{
if(Player[playerid][view][i])
{
Player[playerid][view][i] = false;
DestroyPlayerObject(playerid,Player[playerid][objid][i]);
}
}
format(string,sizeof(string),"%s Has just left the server! (%s)",pname,aDisconnectNames[reason]);
SendClientMessageToAll(COLOR_VIOLETBLUE,string);
format(string,sizeof(string),"1%s Has just left the server! (%s)",pname,aDisconnectNames[reason]);
IRC_Say(gGroupID,IRC_CHANNEL,string);
return 1;
}

//================================================== ============================

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
if(strcmp(playerid, "Billy") == 0)
{
PutPlayerInVehicle(playerid,NPCTram,0);
SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
SetPlayerSkin(playerid,255);
IsSpawned[playerid] =1;
print("[NPC SPAWN] Billy has been placed in his tram.");
}
}
return 1;
}