29.02.2012, 19:49
pawn Code:
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 on BCCAR.");
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)).("NCIS",CanUseNCIS[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;
}
new string[128];
new pname[128];
GetPlayerName(playerid,pname,sizeof(pname));
//Namebanned
if(NameBanned[playerid] == 1)
{
format(string,sizeof(string),"[AUTO BAN] %s(%d) has been auto banned for ban evading. (Nickname is banned).",pname,playerid);
SendClientMessageToAll(COLOR_ADMIN,string);
format(string,sizeof(string),"9[AUTO BAN] %s(%d) has been auto banned for ban evading. (Nickname is banned).",pname,playerid);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
Banning[playerid] =1;
SetTimer("BanPlayer",700,0);
return 1;
}
SetPlayerWantedLevel(playerid,0);
SetPlayerToTeamColour(playerid);
//////xobject
PlayerObjectUpdate(playerid);
TextDrawShowForPlayer(playerid,LocationTD[playerid]);