Classes
pawn Код:
AddPlayerClass(161,2118.0212,-2173.2434,18.5469,126.3903,0,0,0,0,0,0);
AddPlayerClass(179,2829.9478,918.4404,10.7500,279.6504,0,0,0,0,0,0);
AddPlayerClass(181,1681.0226,975.8158,10.7789,353.4319,0,0,0,0,0,0);
AddPlayerClass(206,1069.5417,1268.4760,10.8203,176.1641,0,0,0,0,0,0);
AddPlayerClass(248,-84.7425,-1126.5870,1.0781,266.0118,0,0,0,0,0,0);
AddPlayerClass(260,-488.8553,-534.6000,25.5296,348.8983,0,0,0,0,0,0);
AddPlayerClass(132,-2162.8982,-225.4068,36.5156,0.8460,0,0,0,0,0,0);
AddPlayerClass(265,1568.39,-1691.35,5.89,126.3903,0,0,0,0,0,0);
AddPlayerClass(266,-1616.66,684.16,7.19,126.3903,0,0,0,0,0,0);
AddPlayerClass(267,2295.05,2459.06,10.82,126.3903,0,0,0,0,0,0);
AddPlayerClass(7,2192.24,-2262.79,13.55,126.3903,0,0,0,0,0,0);
AddPlayerClass(50,-1861.86,-145.30,11.89,126.3903,0,0,0,0,0,0);
AddPlayerClass(16,2699.44,861.35,10.14,126.3903,0,0,0,0,0,0);
OnPlayerConnect
pawn Код:
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
playerdata[playerid][allowteleport] = 0;
playerdata[playerid][blockpm] = 0;
playerdata[playerid][seepms] = 0;
playerdata[playerid][playerwired] = 0;
playerdata[playerid][level] = 0;
playerdata[playerid][pWarnings]=0;
playerdata[playerid][PlayerWired]=0;
playerdata[playerid][logged] = 0;
playerdata[playerid][Joins]=0;
playerdata[playerid][Deaths]=0;
playerdata[playerid][Kills]=0;
playerdata[playerid][PlayerFrozen] = 0;
playerdata[playerid][Kicks]=0;
playerdata[playerid][vip]=0;
playerdata[playerid][fines]=0;
playerdata[playerid][mace]=0;
playerdata[playerid][cigar]=0;
playerdata[playerid][wine] = 0;
playerdata[playerid][sprunk]=0;
playerdata[playerid][beer]=0;
playerdata[playerid][phone]=0;
playerdata[playerid][disabled]=0;
playerdata[playerid][warns]=0;
playerdata[playerid][insured]=0;
playerdata[playerid][slots]=0;
playerdata[playerid][maxslots]=0;
SetTimerEx("Save", 25000, true, "i", playerid);
TextDrawShowForPlayer(playerid,ServerTimeTD);
new pname[MAX_PLAYER_NAME], query[150];
GetPlayerName(playerid, pname, sizeof(pname));
format(query, sizeof(query), "SELECT * FROM `accounts` WHERE `name` = '%s';", pname);
mysql_query(query); mysql_store_result();
if(mysql_num_rows() != 0)
{
format(s, sizeof(s), "{FFFF00}%s {FFFFFF}is registered.\nPlease {AA3333}Login.", pname);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Please Login",s,"Login","Screw This");
}
else
{
format(s, sizeof(s),"{FFFF00}%s {FFFFFF}is {AA3333}not {FFFFFF}registered.\nPlease enter a password below.", pname);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Please Register",s,"Register","Screw This");
}
mysql_free_result();
for(new i = 0; i < MAX_PLAYERS; i++)
{
pSpectating[playerid][i]=0;
}
ranka[playerid] = Create3DTextLabel("Trucker",COLOR_YELLOW,30.0,40.0,50.0,40.0,0);
rankb[playerid] = Create3DTextLabel("Dispatch",COLOR_GREEN,30.0,40.0,50.0,40.0,0);
rankc[playerid] = Create3DTextLabel("Recovery",COLOR_RED,30.0,40.0,50.0,40.0,0);
rankd[playerid] = Create3DTextLabel("Police",COLOR_BLUE,30.0,40.0,50.0,40.0,0);
GameTextForPlayer(playerid,"~w~Rokzlive ~r~Transportation Nation",5000,5);
SendClientMessage(playerid, COLOR_GREEN, "Welcome! Choose your spawn! Type /menu to learn how to use our server! Type /rules to see rules!");
TextDrawShowForPlayer(playerid,Name);
TextDrawShowForPlayer(playerid,Web);
M_OnPlayerConnect(playerid);
new string[100];
format(string, sizeof(string),"To start a mission type /work");
TextDrawShowForPlayer ( playerid, mission [ playerid ] );
TextDrawSetString(mission [ playerid ],string);
// SPEEDOS[playerid] = TextDrawCreate(10.0,200.0," ");
// TextDrawShowForPlayer(playerid,SPEEDOS[playerid]);
isloggedin[playerid] = 1;
return 1;
}
OnPlayerRequestClass
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if (playerdata[playerid][disabled] == 1)
{
SendClientMessage(playerid,red,"Your account is disabled!");
Kick(playerid);
}
else if(classid == 1)
GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
else if (classid == 2)
GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
else if(classid == 3)
GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
else if (classid == 4)
GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
else if(classid == 5)
GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
else if (classid == 6)
GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
else if(classid == 7)
GameTextForPlayer(playerid,"~b~Police", 3000, 3);
else if(classid == 8)
GameTextForPlayer(playerid,"~b~Police", 3000, 3);
else if(classid == 9)
GameTextForPlayer(playerid,"~b~Police", 3000, 3);
else if (classid == 10)
GameTextForPlayer(playerid,"~r~Recovery", 3000, 3);
else if(classid == 11)
GameTextForPlayer(playerid,"~r~Recovery", 3000, 3);
else if (classid == 12)
GameTextForPlayer(playerid,"~r~Recovery", 3000, 3);
else if(classid == 13)
GameTextForPlayer(playerid,"~w~Trucker", 3000, 3);
return 1;
}
OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
if(alreadyspawned[playerid] == 1)
{
new randInt = random ( 7 );
switch ( randInt )
{
case 0: SetPlayerPos(playerid,2118.0212,-2173.2434,18.5469);
case 1: SetPlayerPos(playerid,2829.9478,918.4404,10.7500);
case 2: SetPlayerPos(playerid,1681.0226,975.8158,10.7789);
case 3: SetPlayerPos(playerid,1069.5417,1268.4760,10.8203);
case 4: SetPlayerPos(playerid,-84.7425,-1126.5870,1.0781);
case 5: SetPlayerPos(playerid,-488.8553,-534.6000,25.5296);
case 6: SetPlayerPos(playerid,-2162.8982,-225.4068,36.5156);
}
return 1;
}
SetPlayerPos(playerid, 2118.0212,-2173.2434,18.5469);
SendClientMessage(playerid,COLOR_YELLOW, "Choose your class!");
ShowPlayerDialog(playerid, 1000000, DIALOG_STYLE_LIST, "Spawn List", "Male Trucker\nFemale Trucker", "Spawn", "Cancel");
// new classid=GetPlayerSkin(playerid);
AntiDeAMX();
// new string[100];
SpawnMessage(playerid);
SetPlayerInterior(playerid,0);
TogglePlayerClock(playerid,0);
SendClientMessage(playerid, COLOR_YELLOW,"Note: Use /money to see how much money you have!");
SetPlayerMoney(playerid, playerdata[playerid][money]);
SetPlayerScore(playerid, playerdata[playerid][score]);
return 1;
}