01.07.2013, 23:30
pawn Код:
public OnPlayerUpdate(playerid)
{
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
PlayerInfo[playerid][pScore] = GetPlayerScore(playerid);
//Stats Command
new string[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
format(string, sizeof (string), "%s", pname);
TextDrawSetString(StTextdraw0,string);
TextDrawShowForPlayer(playerid, StTextdraw0);
format(string, sizeof (string), "Score: %d",PlayerInfo[playerid][pScore]);
TextDrawSetString(StTextdraw2,string);
TextDrawShowForPlayer(playerid, StTextdraw2);
format(string, sizeof (string), "Kills: %d",PlayerInfo[playerid][pKills]);
TextDrawSetString(StTextdraw3,string);
TextDrawShowForPlayer(playerid, StTextdraw3);
format(string, sizeof (string), "Deaths: %d",PlayerInfo[playerid][pDeaths]);
TextDrawSetString(StTextdraw4,string);
TextDrawShowForPlayer(playerid, StTextdraw4);
//GetPlayerIP
new pIPp[16];
GetPlayerIp(playerid, pIPp, sizeof(pIPp));
PlayerInfo[playerid][pIP] =pIPp;
//Anti Armour Hack.
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour >= 100)
{
if(PlayerInfo[playerid][pAdmin] < 10)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof(string),"[ANTI CHEAT] Anti-Cheat has banned %s(%d). [Reason: Cheats Detected]",pName,playerid);
SendClientMessageToAll(COLOR_PINK,string);
format(string,sizeof(string),"1[ANTI CHEAT] Anti-Cheat has banned %s(%d). [Reason: Cheats Detected]",pName,playerid);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
IRC_GroupSay(gGroupID,IRC_ADMINCHANNEL,string);
format(string, sizeof(string), "~r~BANNED!");
GameTextForPlayer(playerid, string, 3000, 1);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Player's Data");
INI_WriteString(File,"BanReason","Cheats Detected");
INI_Close(File);
PlayerInfo[playerid][pBanned] =1;
SetTimerEx("KickPlayer",1000,false,"i",playerid);
return 1;
}
}
if(!IsPlayerInRangeOfPoint(playerid, 3.0, 586.52, 870.34, -42.50) && TOZN1CP[playerid] == 1)
{
if(gTeam[playerid] != TEAM_MEDIC)
{
SendClientMessage(playerid, COLOR_RED, "[TAKE OVER FAILED] You have left the checkpoint, You have failed to capture the Nuclear Base.");
GangZoneStopFlashForAll(NuclearZone1);
SendClientMessageToAll(COLOR_RED, "[TAKE OVER FAILED] Nuclear Base was not taken over.");
KillTimer(TONZ1Timer);
TOZN1CP[playerid] = 0;
NZTAKENOVER =0;
}
}
if(NZ1FORGANG == 0 && NZ1FORARMY == 0)
{
GangZoneShowForAll(NuclearZone1,0xFF80C096);
format(string, sizeof (string), "Nuclear: N");
TextDrawSetString(StTextdraw5,string);
TextDrawShowForPlayer(playerid, StTextdraw5);
}
if(NZ1FORARMY == 1 && NZ1FORGANG == 0)
{
GangZoneShowForAll(NuclearZone1,COLOR_GREEN);
format(string, sizeof (string), "Nuclear: ARMY");
TextDrawSetString(StTextdraw5,string);
TextDrawShowForPlayer(playerid, StTextdraw5);
}
if(NZ1FORGANG == 1 && NZ1FORARMY == 0)
{
GangZoneShowForAll(NuclearZone1,COLOR_RED);
format(string, sizeof (string), "Nuclear: GANG");
TextDrawSetString(StTextdraw5,string);
TextDrawShowForPlayer(playerid, StTextdraw5);
}
if(InAdminMode[playerid] == 1)
{
SetPlayerColor(playerid,COLOR_PINK);
GivePlayerWeapon(playerid,38,999999);
SetPlayerHealth(playerid,999999);
SetPlayerArmour(playerid,999999);
}
if(gTeam[playerid] == TEAM_MEDIC)
{
format(string, sizeof (string), "Rank: Medic");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
//Team_GREEN
if(gTeam[playerid] == TEAM_GREEN)
{
if(GetPlayerScore(playerid) >= 1500)
{
IsGeneral[playerid] =1;
format(string, sizeof (string), "Rank: General");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 1000)
{
IsColonel[playerid] =1;
format(string, sizeof (string), "Rank: Colonel");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 800)
{
IsCaptain[playerid] =1;
format(string, sizeof (string), "Rank: Captain");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 600)
{
IsSpecops[playerid] =1;
format(string, sizeof (string), "Rank: Spec-ops");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 400)
{
IsMajor[playerid] =1;
format(string, sizeof (string), "Rank: Major");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 250)
{
IsLieutenant[playerid] =1;
format(string, sizeof (string), "Rank:Lieutenant");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 150)
{
IsSoldier[playerid] =1;
format(string, sizeof (string), "Rank: Soldier");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 100)
{
IsPrivateFC[playerid] =1;
format(string, sizeof (string), "Rank: PrivateFC");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 50)
{
IsPrivate[playerid] =1;
format(string, sizeof (string), "Rank: Private");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) < 50)
{
IsNewbie[playerid] =1;
format(string, sizeof (string), "Rank: Newbie");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
}
//Team_RED
if(gTeam[playerid] == TEAM_RED)
{
if(GetPlayerScore(playerid) >= 1500)
{
IsGodFather[playerid] =1;
format(string, sizeof (string), "Rank:GodFather");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 1000)
{
IsGodFatherBodyGuard[playerid] =1;
format(string, sizeof (string), "Rank:Bodyguard");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 800)
{
IsLeader[playerid] =1;
format(string, sizeof (string), "Rank: Leader");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 600)
{
IsCoLeader[playerid] =1;
format(string, sizeof (string), "Rank: CoLeader");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 400)
{
IsTripleOriginalGangster[playerid] =1;
format(string, sizeof (string), "Rank: Triple O");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 250)
{
IsDoubleOriginalGangster[playerid] =1;
format(string, sizeof (string), "Rank: Double O");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 150)
{
IsOriginalGangster[playerid] =1;
format(string, sizeof (string), "Rank: OriginalO");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 100)
{
IsOriginalBabyGangster[playerid] =1;
format(string, sizeof (string), "Rank: OriginalB");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) >= 50)
{
IsBabyGangster[playerid] =1;
format(string, sizeof (string), "Rank: Baby G");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
if(GetPlayerScore(playerid) < 50)
{
IsTinyGangster[playerid] =1;
format(string, sizeof (string), "Rank: Tiny G");
TextDrawSetString(StTextdraw1,string);
TextDrawShowForPlayer(playerid, StTextdraw1);
return 1;
}
}
return 1;
}
anyone?