12.05.2018, 20:08
Quote:
PHP код:
|
PHP код:
new SKIN_MODELS[] = {
21,
2,
124,
122,
285,
108,
248,
295,
159,
50,
296,
287
};
new SKIN_NAMES[][] = {
"__Negros",
"_Civiles",
"___Mafia",
"____Nang",
"____Swat",
"_Surenos",
"___Biker",
"____Rich",
"_Farmers",
"Mechanic",
"____Pimp",
"Soldados"
};
public OnPlayerRequestClass(playerid, classid)
{
PlayAudioStreamForPlayer(playerid, "http://www.debbiewiseman.co.uk/samples/warriors.mp3");
SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0);
TogglePlayerSpectating(playerid, true);
SetTimerEx("login_dialog", 0, 0, "i", playerid);
const MAX_SKINS = 312;
static string[MAX_SKINS * 16];
if (string[0] == EOS) {
for (new i; i < MAX_SKINS; i++) {
format(string, sizeof string, "%s%i\tID: %i\n", string, i, i);
}
}
return ShowPreviewModelDialog(playerid, 0, "Selecciуn de Equipo", SKIN_MODELS,SKIN_NAMES , "Select", "Cancel");
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0)
{
switch(listitem)
{
case 0: {
switch(random(6)) // Negros
{
case 0:
{
GameTextForPlayer(playerid, "~g~Skin Changed!", 3000, 3);
SetPlayerSkin(playerid, 21);
SetSpawnInfo(playerid,0,21,-2636.9077,260.5389,4.3281,75.9486,30,150,25,50,29,150);
SetPlayerColor(playerid, color_NEGROS);
}
case 1:
{
GameTextForPlayer(playerid, "~g~Skin Changed!", 3000, 3);
SetPlayerSkin(playerid, 21);
SetSpawnInfo(playerid,0,21,-2659.7424,260.6835,4.6328,20.2774,30,150,25,50,29,150);
SetPlayerColor(playerid, color_NEGROS);
}
case 2:
{
GameTextForPlayer(playerid, "~g~Skin Changed!", 3000, 3);
SetPlayerSkin(playerid, 21);
SetSpawnInfo(playerid,0,21,-2695.9822,262.4749,4.6328,258.9438,30,150,25,50,29,150);
SetPlayerColor(playerid, color_NEGROS);
}
case 3:
{
GameTextForPlayer(playerid, "~g~Skin Changed!", 3000, 3);
SetPlayerSkin(playerid, 21);
SetSpawnInfo(playerid,0,21,-2694.5286,276.3913,4.3359,230.1168,30,150,25,50,29,150);
SetPlayerColor(playerid, color_NEGROS);
}
case 4:
{
GameTextForPlayer(playerid, "~g~Skin Changed!", 3000, 3);
SetPlayerSkin(playerid, 21);
SetSpawnInfo(playerid,0,21,-2659.1301,275.6968,4.3359,79.7154,30,150,25,50,29,150);
SetPlayerColor(playerid, color_NEGROS);
}
case 5:
{
GameTextForPlayer(playerid, "~g~Skin Changed!", 3000, 3);
SetPlayerSkin(playerid, 21);
SetSpawnInfo(playerid,0,21,-2665.8315,237.6608,4.3359,96.0087,30,150,25,50,29,150);
SetPlayerColor(playerid, color_NEGROS);
}
}
}
}
return 1;
}
CMD:class(playerid,params[])
{
GetPlayerHealth(playerid, health);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Equipos","\nNegros\nCiviles\nMafia\nNang\nSwat\nSurenos\nBiker\nRich\nFarmers\nMechanic\nPimp\nSoldados" , "Select", "");
SendClientMessage(playerid, -1, "Your class will be changed in 10 seconds.");
SetTimerEx("ClassSelection", 10000, false, "i", playerid);
}
public ClassSelection(playerid, dialogid, response, listitem, inputtext[])
{
switch(listitem)
{
case 0: {
switch(random(6)) // Negros
{
case 0:
{
SetPlayerSkin(playerid, 19);
GivePlayerWeapon(playerid, 30, 150);
GivePlayerWeapon(playerid, 25, 50);
GivePlayerWeapon(playerid, 29, 150);
SetPlayerColor(playerid, color_NEGROS);
}
case 1:
{
SetPlayerSkin(playerid, 19);
SetPlayerPos(playerid, -2659.7424,260.6835,4.6328);
GivePlayerWeapon(playerid, 30, 150);
GivePlayerWeapon(playerid, 25, 50);
GivePlayerWeapon(playerid, 29, 150);
SetPlayerColor(playerid, color_NEGROS);
}
case 2:
{
SetPlayerSkin(playerid, 19);
SetPlayerPos(playerid, -2695.9822,262.4749,4.6328);
GivePlayerWeapon(playerid, 30, 150);
GivePlayerWeapon(playerid, 25, 50);
GivePlayerWeapon(playerid, 29, 150);
SetPlayerColor(playerid, color_NEGROS);
}
case 3:
{
SetPlayerSkin(playerid, 19);
SetPlayerPos(playerid, -2694.5286,276.3913,4.3359);
GivePlayerWeapon(playerid, 30, 150);
GivePlayerWeapon(playerid, 25, 50);
GivePlayerWeapon(playerid, 29, 150);
SetPlayerColor(playerid, color_NEGROS);
}
case 4:
{
SetPlayerSkin(playerid, 19);
SetPlayerPos(playerid,-2659.1301,275.6968,4.3359);
GivePlayerWeapon(playerid, 30, 150);
GivePlayerWeapon(playerid, 25, 50);
GivePlayerWeapon(playerid, 29, 150);
SetPlayerColor(playerid, color_NEGROS);
}
case 5:
{
SetPlayerSkin(playerid, 19);
SetPlayerPos(playerid, -2665.8315,237.6608,4.3359);
GivePlayerWeapon(playerid, 30, 150);
GivePlayerWeapon(playerid, 25, 50);
GivePlayerWeapon(playerid, 29, 150);
SetPlayerColor(playerid, color_NEGROS);
}
}
}