Help with one thing.
#1

just a small question that if I type a command,the player name turns to wolf and when I again type the command it turns back t its original name.Please help.
Reply
#2

If I understand you question,you can use SetPlayerName,you need save the original name in a variable,and later, restore to original name.
Reply
#3

realy can't figure it out please help me with some codes please.
Reply
#4

pawn Код:
//Top:
new Name[MAX_PLAYERS][MAX_PLAYER_NAME];
new bool:Changed[MAX_PLAYERS];
//Command
CMD:wolf(playerid,params[])
{
     if(Changed[playerid] == false)
     {
          GetPlayerName(playerid,Name[playerid],24);
          SetPlayerName(playerid,"Wolf");
          Changed[playerid] = true;
          return 1;
     }
     else
     {
          SetPlayerName(playerid,Name[playerid]);
          Changed[playerid] = false;
          return 1;
     }
     return 1;
}
Try.
Reply
#5

pawn Код:
#include <a_samp>
#include <zcmd>

new OldName[128];
new i =0;

public OnPlayerDisconnect(playerid)
{
    if( i == 1 )
    {
        SetPlayerName(playerid, OldName);
    }
    return 1;
}

CMD:name(playerid, params[])
{
        GetPlayerName(playerid, OldName, sizeof(OldName));
        SetPlayerName(playerid, "Wolf");
        SendClientMessage(playerid, -1, "Your name was setted to Wolf");
        i=1;
        return 1;
}

CMD:restorename(playerid, params[])
{
    SetPlayerName(playerid, OldName);
    new String[128];
    format(String, sizeof(String), "Your name was restored to %s", OldName);
    SendClientMessage(playerid, -1, String);
    i=0;
    return 1;
}
EDIT: Oh I didn't see the previous post :O
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)