09.03.2011, 09:47
Код:
public OnPlayerConnect(playerid) { new playrname[MAX_PLAYER_NAME]; PreloadAnimLib(playerid,"BOMBER"); PreloadAnimLib(playerid,"RAPPING"); PreloadAnimLib(playerid,"SHOP"); PreloadAnimLib(playerid,"BEACH"); PreloadAnimLib(playerid,"SMOKING"); PreloadAnimLib(playerid,"FOOD"); PreloadAnimLib(playerid,"ON_LOOKERS"); PreloadAnimLib(playerid,"DEALER"); PreloadAnimLib(playerid,"CRACK"); PreloadAnimLib(playerid,"CARRY"); PreloadAnimLib(playerid,"COP_AMBIENT"); PreloadAnimLib(playerid,"PARK"); PreloadAnimLib(playerid,"INT_HOUSE"); PreloadAnimLib(playerid,"FOOD"); PreloadAnimLib(playerid,"PED"); PlayerInfo[playerid][SpawnDance] = true; SetTimerEx("Autorepair",500,true,"d",playerid); new Text:text = TextDrawCreate(5.0, 400.0,Text_Under_Minimap); TextDrawUseBox(text, 0); TextDrawFont(text, 1); TextDrawSetShadow(text,0); TextDrawSetOutline(text,1); TextDrawBackgroundColor(text,0x000000FF); TextDrawColor(text,0xFFFFFFFF); TextDrawShowForPlayer(playerid, text); GameTextForPlayer(playerid,"~w~ ~r~ Gta Arena ~g~ Party ~b~ Server ~B~ Mode",5000,5); SendPlayerFormattedText(playerid, "Welcome to Gta Arena Party Server ", 0); SendPlayerFormattedText(playerid, "Have Fun Its A Gta Arena Server",0); SendClientMessage(playerid, COLOR_GREEN, "Please type /help to get started."); SendClientMessage(playerid, COLOR_GREEN, "Join Export Vehicle and get into the place to win cash."); SendClientMessage(playerid, COLOR_GREEN, "If u want your stats to be saved than get registered use /register password."); SendClientMessage(playerid, COLOR_GREEN, "If u want to save your position use /savepos and than to go back use /r."); SendClientMessage(playerid, COLOR_GREEN, "Your stats are being stored in our database."); SendClientMessage(playerid, COLOR_GREEN, "Please visit our forum : www.Arena-Gta.tk."); SendClientMessage(playerid, COLOR_GREEN, "Use /Teleports."); gActivePlayers[playerid]++; gLastGaveCash[playerid] = GetTickCount(); playerCheckpoint[playerid]=999; bank[playerid]=0; playerGang[playerid]=0; gangInvite[playerid]=0; GetPlayerName(playerid, playrname, sizeof(playrname)); for(new i = 0; i < MAX_SAVE; i++) { if(isStringSame(savedNames[i], playrname, MAX_PLAYER_NAME)) { GivePlayerMoney(playerid, savedInfo[i][0]); bank[playerid] = savedInfo[i][1]; bounty[playerid] = savedInfo[i][2]; savedInfo[i][0]=savedInfo[i][1]=savedInfo[i][2]=0; savedNames[i][0]=0; for(new j = 0; j < MAX_WEAPONS; j++) { playerWeapons[playerid][j]=savedWeapons[i][j]; savedWeapons[i][j]=0; } SendClientMessage(playerid, COLOR_GREEN, "Your money has been restored."); } } PLAYERLIST_authed[playerid]=false; return false; }
Код:
public OnPlayerDisconnect(playerid) { new playername[MAX_PLAYER_NAME]; KillTimer( PlayerInfo[playerid][SpawnTimer] ); gActivePlayers[playerid]--; for(new i = 0; i < MAX_PROPERTIES; i++) { if(propertyOwner[i]==playerid) { propertyOwner[i] = 999; GivePlayerMoney(playerid, propertyValues[i]); } } //Save temp info for timeouts/crashes GetPlayerName(playerid, playername, sizeof(playername)); format(savedNames[savePos], MAX_PLAYER_NAME, "%s",playername); savedInfo[savePos][0] = GetPlayerMoney(playerid); savedInfo[savePos][1] = bank[playerid]; savedInfo[savePos][2] = bounty[playerid]; savedInfo[savePos][3] = 0; for(new i = 0; i < MAX_WEAPONS; i++) savedWeapons[savePos][i]=playerWeapons[playerid][i]; // savePos++; if(savePos >= MAX_SAVE) savePos = 0; PlayerLeaveGang(playerid); bounty[playerid] = 0; for(new i = 0; i < MAX_WEAPONS;i++) { playerWeapons[playerid][i]=0; } if (PLAYERLIST_authed[playerid]) { // Was loggedin, so save the data! dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid)); } PLAYERLIST_authed[playerid]=false; return false; }