SA-MP Forums Archive
GetPlayerSkin[Help] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetPlayerSkin[Help] (/showthread.php?tid=137043)



GetPlayerSkin[Help] - Steven82 - 27.03.2010

How do i use this command so when someone does a command it saves there skin, then when they do like EX:
/onduty
saves the skin for the later command below.

/offduty

it puts back there Civilian skin.


Re: GetPlayerSkin[Help] - ZeRo_HUN - 27.03.2010

You can do it with a global variable. Example :

Код:
//It will store the players' skin
new iPlayerSkin[ MAX_PLAYERS ];

public OnPlayerCommandText( playerid, cmdtext[ ] ) {
  if( strcmp( "/onduty", cmdtext, true ) == 0 ) {
    //Store the actual skin
    iPlayerSkin[ playerid ] = GetPlayerSkin( playerid );
    //Other codes... ( for example SetPlayerSkin... )
    return 1;
  }

  if( strcmp( "/offduty", cmdtext, true ) == 0 ) {
    //Load the stored skin
    SetPlayerSkin( playerid, iPlayerSkin[ playerid ] );
    return 1;
  }
  return 0;
}



Re: GetPlayerSkin[Help] - HuRRiCaNe - 27.03.2010

Main:
new SavedSkin[MAX_PLAYERS];

You can use dcmd or strcmp
and on your command
"/onduty"

SavedSkin[playerid] = GetPlayerSkin(playerid);

and
"/offduty"

SetPlayerSkin(playerid,SavedSkin[playerid]);



Re: GetPlayerSkin[Help] - Torran - 27.03.2010

Quote:
Originally Posted by BiG_Sm0k3
Main:
new SavedSkin[MAX_PLAYERS];

You can use dcmd or strcmp
and on your command
"/onduty"

SavedSkin[playerid] = GetPlayerSkin(playerid);

and
"/offduty"

SetPlayerSkin(playerid,SavedSkin[playerid]);
The guy above you just said the exact same thing?


Re: GetPlayerSkin[Help] - HuRRiCaNe - 27.03.2010

Quote:
Originally Posted by Joe Torran C
Quote:
Originally Posted by BiG_Sm0k3
Main:
new SavedSkin[MAX_PLAYERS];

You can use dcmd or strcmp
and on your command
"/onduty"

SavedSkin[playerid] = GetPlayerSkin(playerid);

and
"/offduty"

SetPlayerSkin(playerid,SavedSkin[playerid]);
The guy above you just said the exact same thing?
See when i posted it, 1 min after, or so didnt know he posted that!


Re: GetPlayerSkin[Help] - Torran - 27.03.2010

You should of noticed after 1 minute :P


Re: GetPlayerSkin[Help] - Steven82 - 27.03.2010

That is a lie it tells you when you click post that someone just posted a reply. xD