HELP ME PLEASE FAST..... EASY
#1

How can I make the server save the players skin they had before doing /duty, and give it back to them when they do /dutyoff




Код:
COMMAND:duty(playerid, params[])
{
	if(IsPlayerConnected(playerid))
 	{
		if(IsPlayerInRangeOfPoint(playerid, 2.0, 1555.097900, -1675.848754, 16.195312))
		{
			SetPlayerColor(playerid, 0x0259EAAA);
			SetPlayerSkin(playerid,281);
			SendClientMessage(playerid, 0x0259EAAA, "You Are Now A Cop, Use /equip To Get Weapons.");
			return 1;
		}
		else return SendClientMessage(playerid, 0x0259EAAA, "You Are Not In LSPD Entrance.");
  	}
    else return SendClientMessage(playerid, 0x0259EAAA, "Player Is Not Online");
}

COMMAND:dutyoff(playerid, params[])
{
    if(GetPlayerColor(playerid) == 0x0259EAAA)
    {
        if(IsPlayerConnected(playerid))
        {
			SetPlayerColor(playerid, 0xFFFFFFAA);
			ResetPlayerWeapons(playerid);
			SendClientMessage(playerid, 0x0259EAAA, "You Are Now Off Duty.");
    		return 1;
        }
        else return SendClientMessage(playerid, 0x0259EAAA, "Player Is Not Online");
    }
    else return SendClientMessage(playerid, 0x0259EAAA, "Only Cops Can Use This Command.");
}
Reply
#2

wait i try :P
Reply
#3

Thanks!
Reply
#4

This is relatively Simple.
Add this on the Begining of your script, after the #define
Код:
new PlayerS[MAX_PLAYERS];
and in the off duty command:

Код:
SetPlayerSkin(playerid,PlayerS[playerid])
Now, I dont know when you want it to remember its skin
but there where you want it
put this in:

Код:
PlayerS[playerid] = GetPlayerSkin(playerid);
Reply
#5

It just sets the skin to 0(CJ) when i do dutyoff
Reply
#6

Wait.... I think I know the problem... everyone spawns as CJ untill they log in... any possibility you could give me a code for a timer that gets the skin like 30 secconds after connecting ??
Reply
#7

I've done
Код:
public OnPlayerConnect(playerid)
{
    SetTimerEx("OperateDelay", 10000, true, "i", playerid);
    PlayerS[playerid] = GetPlayerSkin(playerid);
    return 1;
}
but it still gives CJ skin
Reply
#8

Sorry for spamming .... but I've fixed it by putting it on OnPlayerSpawn instead of OnPlayerConnect
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)