08.04.2013, 12:06
I am scripting a gm but it is not showing onplayerdissconect message though they are alright
Script lines :- 28000
Editor :- Pawno
public OnPlayerDisconnect(playerid, reason) { pMoney[playerid] = 0; 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); } DestroyObject(Ramp[playerid]); DestroyVehicle(Acar[playerid]); RemovePlayerAttachedObject( playerid, 0 ); RemovePlayerAttachedObject( playerid, 1 ); RemovePlayerAttachedObject( playerid, 2 ); RemovePlayerAttachedObject( playerid, 3 ); RemovePlayerAttachedObject( playerid, 4 ); RemovePlayerAttachedObject( playerid, 5 ); RemovePlayerAttachedObject( playerid, 6 ); if(P1InDuel == playerid) { SendClientMessage(playerid,COLOR_GREY,"[Duel] Your enemy left ...."); new dmsg[256]; SetPlayerPos(P2InDuel,1099.5865,1601.4128,12.5469); SetPlayerInterior(playerid,0); format(dmsg,256,"[Duel] %s[%d] has left the duel (Quit)",PlayerName(playerid),playerid); SendClientMessage(playerid,COLOR_DUEL,dmsg); P1InDuel = -1; P2InDuel = -1; DINUSE = 0; } else if(P2InDuel == playerid) { SendClientMessage(playerid,COLOR_GREY,"[Duel] Your enemy left ...."); new dmsg[256]; SetPlayerPos(P1InDuel,1099.5865,1601.4128,12.5469); SetPlayerInterior(playerid,0); format(dmsg,256,"[Duel] %s[%d] has left the duel (Quit)",PlayerName(playerid),playerid); SendClientMessage(playerid,COLOR_DUEL,dmsg); P1InDuel = -1; P2InDuel = -1; DINUSE = 0; } if(VIP[playerid] == 1337) { new vc = VIPC[playerid]; DestroyVehicle(vc); } new string[128]; new pname[24]; GetPlayerName(playerid,pname,sizeof(pname)); //Save Wanted Level && Jailtime SavedWantedLevel[playerid] =GetPlayerWantedLevel(playerid); SavedJailTime[playerid] =JailTime[playerid]; Money[playerid] = GetPlayerMoney(playerid); if(PLAYERLIST_authed[playerid] == 1) { dUserSetINT(PlayerName(playerid)).("Bankcash",BankCash[playerid]); dUserSetINT(PlayerName(playerid)).("Money",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)).("AutobahnOwner",AutobahnOwner[playerid]); dUserSetINT(PlayerName(playerid)).("TSkill",TerroristSkill[playerid]); dUserSetINT(PlayerName(playerid)).("Robskill",Robskill[playerid]); dUserSetINT(PlayerName(playerid)).("CopRank",CopRank[playerid]); dUserSetINT(PlayerName(playerid)).("SavedWantedLevel",SavedWantedLevel[playerid]); dUserSetINT(PlayerName(playerid)).("SavedJailTime",SavedJailTime[playerid]); dUserSetINT(PlayerName(playerid)).("TRP",TRP[playerid]); dUserSetINT(PlayerName(playerid)).("BailCards",BailCards[playerid]); dUserSetINT(PlayerName(playerid)).("VIP",VIP[playerid]); dUserSetINT(PlayerName(playerid)).("Deaths",Deaths[playerid]); dUserSetINT(PlayerName(playerid)).("Kills",Kills[playerid]); } //Do things to the playerid ResetVariables(playerid); TextDrawShowForPlayer(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_GREY,string); format(string,sizeof(string),"1%s Has just left the server! (%s)",pname,aDisconnectNames[reason]); IRC_Say(gGroupID,IRC_CHANNEL,string); return 1; }