17.10.2017, 17:24
i got skin command + i made 2 classes that are TEAM one GROVE and one BALLAS i spawned as GROVE and i typed /skin 230 my skin got changed but when i died i spawned at default LV position where bare script has but i have set GROVE and BALLAS custom locations whenever i typed /skin command and changed my skin grove to any other server can't recognize my spawn position
code :
skin command code :
code :
PHP код:
public OnPlayerSpawn(playerid)
{
TextDrawShowForAll(discord[0]);
TextDrawShowForAll(discord[1]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerInterior(playerid, 0);
TogglePlayerClock(playerid, 0);
ResetPlayerWeapons(playerid);
new Skin = GetPlayerSkin(playerid);
switch(Skin)
{
case 102,104:
{
SetPlayerTeam(playerid, BALLAS);
GivePlayerWeapon(playerid, 24, 200);
GivePlayerWeapon(playerid, 25, 200);
GivePlayerWeapon(playerid, 28, 200);
GivePlayerWeapon(playerid, 34, 200);
GivePlayerWeapon(playerid, 30, 200);
SetPlayerPos(playerid, -2569.7415, 892.6765, 64.9844);
}
case 106,107:
{
SetPlayerTeam(playerid, GROVE);
GivePlayerWeapon(playerid, 24, 200);
GivePlayerWeapon(playerid, 25, 200);
GivePlayerWeapon(playerid, 32, 200);
GivePlayerWeapon(playerid, 34, 200);
GivePlayerWeapon(playerid, 31, 200);
SetPlayerPos(playerid, -1704.2889, 1018.0909, 17.5859);
}
}
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
if(classid == 0)
{
SetPlayerSkin(playerid, 102);
GameTextForPlayer(playerid, "~p~Ballas", 1000, 4);
SetPlayerColor(playerid, COLOR_PURPLE);
gTeam[playerid] = 0;
}
if(classid == 1)
{
SetPlayerSkin(playerid, 104);
GameTextForPlayer(playerid, "~p~Ballas", 1000, 4);
SetPlayerColor(playerid, COLOR_PURPLE);
gTeam[playerid] = 0;
}
if(classid == 2)
{
SetPlayerSkin(playerid, 106);
GameTextForPlayer(playerid, "~g~Grove", 1000, 4);
SetPlayerColor(playerid, COLOR_GREEN);
gTeam[playerid] = 1;
}
if(classid == 3)
{
SetPlayerSkin(playerid, 107);
GameTextForPlayer(playerid, "~g~Grove", 1000, 4);
SetPlayerColor(playerid, COLOR_GREEN);
gTeam[playerid] = 1;
}
SetupPlayerForClassSelection(playerid);
return 1;
}
PHP код:
CMD:skin(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not allowed to use this command");
new skinnumber, skinid, string[128];
if(sscanf(params, "d", skinid)) SendClientMessage(playerid, COLOR_WHITE, "{FF6600}Usage: {FFFFFF}/skin [0-299]");
else if(skinid < 0 || skinid > 299) SendClientMessage(playerid, COLOR_RED, "Invalid skin ID, Select skin from {AFAFAF}[0-299]");
else
{
SetPlayerSkin(playerid, skinid);
skinnumber = GetPlayerSkin(playerid);
format(string, sizeof(string), "You have changed your skin to {AFAFAF}%d", skinnumber);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
return 1;
}