How to add the name to /duty and this object id.
#1

pawn Код:
if (strcmp("/duty3s", cmdtext, true, 10) == 0)
    {   SetPlayerSkin(playerid,287);
        GivePlayerWeapon(playerid,24,100);
        GivePlayerWeapon(playerid,31,1000);
        SetPlayerColor(playerid,0xFF0808);
        new string[35];
        format(string,sizeof(string),"General %i  is Now onduty.","Name");
        SendClientMessage(playerid,0xFFFFFAA,string);
       // player dead
       return 1;
    }
When i do that its only shows numbers and whaen i use %c its show a ex:General N Is Now onduty
Now the Object id:
Reply
#2

%i is for integers, aka numbers. %s is used to store strings. Your "Name" is also undefined.
pawn Код:
if (strcmp("/duty3s", cmdtext, true, 10) == 0)
{
    SetPlayerSkin(playerid,287);
    GivePlayerWeapon(playerid,24,100);
    GivePlayerWeapon(playerid,31,1000);
     SetPlayerColor(playerid,0xFF0808);
    new string[35];
    new name[24];
    format(string,sizeof(string),"General %s is Now onduty.",GetPlayerName(playerid,name,24));
    SendClientMessage(playerid,0xFFFFFAA,string);
    // player dead
    return 1;
}
Reply
#3

I'm not sure, but I think you can not use it here
pawn Код:
new name[24];
format(string,sizeof(string),"General %s is Now onduty.",GetPlayerName(playerid,name,24));
use so
pawn Код:
name[24];
GetPlayerName(playerid,name,24);
format(string,sizeof(string),"General %s is Now onduty.",name);
and the string is short
Reply
#4

That would produce the same result.
Reply
#5

i don't know...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)