09.11.2008, 21:02
my gm is penls
THIS IS THE SECTION OnPlayerConnect. Can you modify it ?
THIS IS THE SECTION OnPlayerConnect. Can you modify it ?
Код:
public OnPlayerConnect(playerid) { if (gdebug >= 1){printf("DEBUG OnPlayerConnect(%d)", playerid);} gActivePlayers[playerid]++; numplayers++; new plname[128]; new playaname[128]; new string[128]; //TelePos[playerid][0] = 0; //TelePos[playerid][1] = 0; //TelePos[playerid][2] = 0; SafeTime[playerid] = 60; BetRace[playerid][0] = 255; BetRace[playerid][1] = 0; BetDm[playerid][0] = 255; BetDm[playerid][1] = 0; //HidePM[playerid] = 0; gPlayerFighter[playerid] = 0; DmScore[playerid] = 0; Mobile[playerid] = 255; Spectate[playerid] = 255; Unspec[playerid][sLocal] = 255; gSkyDive[playerid] = 0; TVMode[playerid] = 0; gLastCar[playerid] = 0; FirstSpawn[playerid] = 0; gPlayerLapStatus[playerid] = 0; gOoc[playerid] = 0; BigEar[playerid] = 0; FlashTime[playerid] = 0; gDice[playerid] = 0; gSpeedo[playerid] = 0; gPlayerLogged[playerid] = 0; gPlayerAccount[playerid] = 0; gPlayerSpawned[playerid] = 0; LapCount[playerid] = 0; Mute[playerid] = 0; StartTime[playerid] = 0; gRaceGuy[playerid] = 0; Contract[playerid] = 0; gPlayerMission[playerid] = 0; PlayerInfo[playerid][pCash] = dollah; KickVote[playerid] = 0; VoteKick[playerid] = 0; LastVote[playerid] = 255; HireCar[playerid] = 299; Hidden[playerid] = 0; Locator[playerid] = 0; PLicence[playerid] = 0; gPhoneBook[playerid] = 0; //PlayerPos[playerid][3] = 1.0; //PlayerPos[playerid][4] = 1.0; //PlayerPos[playerid][5] = 1.0; GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]); PlayerInfo[playerid][pAccount] = 0; PlayerInfo[playerid][pAdmin] = 0; PlayerInfo[playerid][pLevel] = 1; PlayerInfo[playerid][pExp] = 0; PlayerInfo[playerid][gPupgrade] = 0; PlayerInfo[playerid][pKills] = 0; PlayerInfo[playerid][pCB] = 0; PlayerInfo[playerid][pHW] = 0; PlayerInfo[playerid][pSR] = 0; PlayerInfo[playerid][pWA] = 0; PlayerInfo[playerid][pPEN] = 0; PlayerInfo[playerid][pGun1] = 0; PlayerInfo[playerid][pGun2] = 0; PlayerInfo[playerid][pGun3] = 0; PlayerInfo[playerid][pGun4] = 0; PlayerInfo[playerid][pGun5] = 0; PlayerInfo[playerid][pGun6] = 0; PlayerInfo[playerid][pAmmo1] = 200; PlayerInfo[playerid][pAmmo2] = 8; PlayerInfo[playerid][pAmmo3] = 30; PlayerInfo[playerid][pAmmo4] = 30; PlayerInfo[playerid][pAmmo5] = 10; PlayerInfo[playerid][pAmmo6] = 10; PlayerInfo[playerid][pSHealth] = 0.0; PlayerInfo[playerid][pHealth] = 50.0; PlayerInfo[playerid][pPos_x] = 2246.6; PlayerInfo[playerid][pPos_y] = -1161.9; PlayerInfo[playerid][pPos_z] = 1029.7; PlayerInfo[playerid][pInt] = 15; PlayerInfo[playerid][pLocal] = 255; PlayerInfo[playerid][pTeam] = 1; PlayerInfo[playerid][pModel] = 264; new randphone = 1000 + random(8999);//minimum 1000 max 9999 //giving one at the start PlayerInfo[playerid][pPnumber] = randphone; PlayerInfo[playerid][pPhousekey] = 255; PlayerInfo[playerid][pPbiskey] = 255; PlayerInfo[playerid][pTVec] = 0; ClearCrime(playerid); printf("Player Connecting as (%d)", playerid); SetPlayerColor(playerid,COLOR_GRAD2); GetPlayerName(playerid, plname, sizeof(plname)); GetPlayerName(playerid, playaname, sizeof(playaname)); //SetPlayerCameraPos(playerid,1460.0, -1324.0, 287.2); //SetPlayerCameraLookAt(playerid,1374.5, -1291.1, 239.0); format(playaname,sizeof(playaname),"**** %s joined the server",playaname); SendClientMessageToAll(COLOR_GRAD3,playaname); format(string, sizeof(string), "%s.cer", plname); if(fexist(string)) { gPlayerAccount[playerid] = 1; SendClientMessage(playerid, COLOR_YELLOW, "SERVER: That nick is registered, You have 60 seconds to login"); SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now login by typing /login <password>"); return 1; } else { gPlayerAccount[playerid] = 0; SendClientMessage(playerid, COLOR_YELLOW, "SERVER: Type /regnick <password> to create and account or /help for help"); return 1; } // return 1; } public ClearCrime(playerid) { if (gdebug >= 1){printf("DEBUG ClearCrime(%d)", playerid);} new string[MAX_PLAYER_NAME]; format(string, sizeof(string), "********"); strmid(PlayerCrime[playerid][pBplayer], string, 0, strlen(string), 255); strmid(PlayerCrime[playerid][pVictim], string, 0, strlen(string), 255); strmid(PlayerCrime[playerid][pAccusing], string, 0, strlen(string), 255); strmid(PlayerCrime[playerid][pAccusedof], string, 0, strlen(string), 255); return 1; } public BetWinner(playerid,contest) { new winname[MAX_PLAYER_NAME]; new better[MAX_PLAYER_NAME]; new string[256]; GetPlayerName(playerid, winname, sizeof(winname)); for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) { if(contest == 1) { if(BetRace[i][0] == playerid) { GivePlayerMoney(i,BetRace[i][1]*2); BizzInfo[5][bTakings] -= (BetRace[i][1]*2); format(string, sizeof(string), "______-= %s =-_______", BizzInfo[5][bDiscription]); SendClientMessage(i, TEAM_VAGOS_COLOR,string); format(string, sizeof(string), " You have won $%d on %s in a streetrace", BetRace[i][1]*2, winname); SendClientMessage(i, COLOR_WHITE, string); SendClientMessage(i, TEAM_VAGOS_COLOR,"_______________________________________"); PlayerPlaySound(i, 1052, 0.0, 0.0, 0.0); GetPlayerName(i, better, sizeof(better)); format(string, sizeof(string), "%s won $%d on %s", better, BetRace[i][1]*2, winname); printf("%s", string); PayLog(string); } BetRace[i][0] = 255; BetRace[i][1] = 0; } if(contest == 2) { if(BetDm[i][0] == playerid) { GivePlayerMoney(i,BetDm[i][1]*2); BizzInfo[5][bTakings] -= (BetDm[i][1]*2); format(string, sizeof(string), "______-= %s =-_______", BizzInfo[5][bDiscription]); SendClientMessage(i, TEAM_VAGOS_COLOR,string); format(string, sizeof(string), " You have won $%d on %s in a deathmatch", BetDm[i][1]*2, winname); SendClientMessage(i, COLOR_WHITE, string); SendClientMessage(i, TEAM_VAGOS_COLOR,"_______________________________________"); PlayerPlaySound(i, 1052, 0.0, 0.0, 0.0); GetPlayerName(i, better, sizeof(better)); format(string, sizeof(string), "%s won $%d on %s", better, BetDm[i][1]*2, winname); printf("%s", string); PayLog(string); } BetDm[i][0] = 255; BetDm[i][1] = 0; } } } return 1; }