GetPlayerSkin[Help]
#1

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.
Reply
#2

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;
}
Reply
#3

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]);
Reply
#4

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?
Reply
#5

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!
Reply
#6

You should of noticed after 1 minute :P
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)