pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
SetPlayerPos(playerid, 1981.4408,-2105.0007,13.3446);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
SetPlayerFacingAngle(playerid, 91.0592);
SetPlayerCameraPos(playerid, 1975.1997,-2105.1047,13.3705);
SetPlayerCameraLookAt(playerid, 1981.4408,-2105.0007,13.3446);
return 1;
}
public OnPlayerConnect(playerid)
{
new str[356], ip[16];
new color = random(sizeof(Colors));
for(new i=0;i<47;i++) Weapon[playerid][i] = false;
SetPlayerColor(playerid, COLOR_WHITE);
SetPlayerColor(playerid, Colors[color]);
GetPlayerIp(playerid, ip, sizeof(ip));
pInfo[playerid][Admin] = 0;
pInfo[playerid][VIP] = 0;
pInfo[playerid][Banned] = 0;
pInfo[playerid][Cookies] = 1;
pInfo[playerid][Logged] = 0;
pInfo[playerid][Seconds] = 0;
pInfo[playerid][Minutes] = 0;
pInfo[playerid][Hours] = 0;
pInfo[playerid][Spawn] = 0;
SetPlayerScore(playerid, 0);
pInfo[playerid][Score] = 1;
hasBeenPast[playerid] = 0;
pInfo[playerid][Duty] = 0;
SetPlayerScore(playerid, pInfo[playerid][Score]);
ResetPlayerCash(playerid);
pInfo[playerid][Money] = 100000;
GivePlayerCash(playerid, pInfo[playerid][Money]);
pInfo[playerid][Kills] = 0;
ABike[playerid] = 1;
SB[playerid] = 1;
God[playerid] = 0;
pInfo[playerid][Deaths] = 0;
SetTimerEx("UpdateGamePlay", 1000, true, "i", playerid);
SendClientMessage(playerid, -1, " ");
GameTextForPlayer(playerid, "~w~Stunt ~g~4 ~w~Life!!", 3500, 6);
format(str, sizeof(str), "* %s has been connected to Stunt 4 Life!!", GetName(playerid));
SendClientMessageToAll(COLOR_LIME, str);
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
SendClientMessage(playerid, COLOR_ORANGE, "Weclome to [ Stunt 4 Life ] :: Fun never ends of Stunts!!");
SendClientMessage(playerid, COLOR_YELLOW, "Server owned by Jake, JellalKoayz and BRevoK");
SendClientMessage(playerid, -1, "/help or /cmds for information or commands.");
SendClientMessage(playerid, COLOR_YELLOW, "Fun starts now..");
SendClientMessage(playerid, -1, " ");
if(fexist(Path(playerid)))
{
INI_ParseFile(Path(playerid), "loadaccount_user", .bExtra = true, .extra = playerid);
if(pInfo[playerid][Banned] == 1)
{
for(new x = 0; x < 100; x++)
SendClientMessage(x, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_RED, "You're banned from this server");
SendClientMessage(playerid, COLOR_RED, "Create a ban appeal to unban yourself!");
SendClientMessage(playerid, COLOR_WHITE, "Kicked!");
Kick(playerid);
return 1;
}
for(new i=0; i < IpBanned; i++)
{
if(!strcmp(ib[i], ip, true))
{
for(new x = 0; x < 100; x++)
SendClientMessage(x, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_RED, "You're banned from this server");
SendClientMessage(playerid, COLOR_RED, "Create a ban appeal to unban yourself!");
SendClientMessage(playerid, COLOR_WHITE, "Kicked!");
Kick(playerid);
return 1;
}
}
if(!strcmp(ip, pInfo[playerid][Ip]))
{
INI_ParseFile(Path(playerid), "loadaccount_user", .bExtra = true, .extra = playerid);
SetPlayerScore(playerid, pInfo[playerid][Score]);
ResetPlayerMoney(playerid);
GivePlayerCash(playerid, pInfo[playerid][Money]);
pInfo[playerid][Logged] = 1;
format(str, sizeof(str), "Welcome back, %s, You've been automatically logged in!", GetName(playerid));
SendClientMessage(playerid, COLOR_LIME, str);
format(str, sizeof(str), "You've been online for %i hours, %i minutes, %i seconds", pInfo[playerid][Hours], pInfo[playerid][Minutes], pInfo[playerid][Seconds]);
SendClientMessage(playerid, COLOR_YELLOW, str);
if(pInfo[playerid][Admin] >= 1)
{
new AdminRank[71];
switch(pInfo[playerid][Admin])
{
case 1: AdminRank = "Moderator";
case 2: AdminRank = "Administrator";
case 3: AdminRank = "Junior Administrator";
case 4: AdminRank = "Senior Administrator";
case 5: AdminRank = "Server Manager";
}
format(str, sizeof(str), "AdminLog: %s %s(%d) has been automatically logged in!", AdminRank, GetName(playerid), playerid);
SendClientMessageToAll(COLOR_LIME, str);
new Text3D:Tag = Create3DTextLabel(AdminRank, COLOR_WHITE, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(Tag, playerid, 0.0, 0.0, 0.7);
}
if(pInfo[playerid][VIP] >= 1)
{
new AdminRank[71];
switch(pInfo[playerid][VIP])
{
case 1: AdminRank = "Bronze VIP";
case 2: AdminRank = "Silver VIP";
case 3: AdminRank = "Gold VIP";
}
format(str, sizeof(str), "VipLog: %s %s(%d) has been automatically logged in!", AdminRank, GetName(playerid), playerid);
SendClientMessageToAll(COLOR_ORANGE, str);
new Text3D:Tag = Create3DTextLabel(AdminRank, COLOR_WHITE, 30.0, 40.0, 50.0, 40.0+1, 0);
Attach3DTextLabelToPlayer(Tag, playerid, 0.0, 0.0, 0.7);
}
return 1;
}
format(str, sizeof(str), ""white"Welcome back %s to Stunt 4 Life,\n\nThis account is registered, Please insert your\npassword to login to your account!\nIf you're not the owner of this account.\nPlease leave the game. And use your own username.", GetName(playerid));
ShowPlayerDialog(playerid, Login, DIALOG_STYLE_PASSWORD, ""white"Login", str, "Login", "Exit");
}
else
{
format(str, sizeof(str), ""white"Welcome %s to Stunt 4 Life,\n\nThis account is not registered, Please\ninsert your own password to create your own account!", GetName(playerid));
ShowPlayerDialog(playerid, Register, DIALOG_STYLE_PASSWORD, ""white"Register", str, "Register", "Exit");
}
GetPlayerIp(playerid, pInfo[playerid][Ip], 16);
return 1;
}