Wont Work :(
#1

pawn Код:
CMD:getcookies(playerid, params[])
{
   if(sscanf(params, "u", GiveID)) return SendClientMessage(playerid, RED, "USAGE: /getcookies [ID]");
   {
   if(!IsPlayerConnected(GiveID)) return SendClientMessage(playerid, RED, "ERROR: Player is not connected");
   {
   if(GiveID == playerid) SendClientMessage(playerid, RED, "ERROR: You can check your own cookies using /mycookies");
   {
   new str[256],name2[MAX_PLAYER_NAME];
   format(str, sizeof(str), "Name : %s\n Cookies\n%d", name2, pInfo[GiveID][COOKIES]);
   ShowPlayerDialog(playerid, D_GETCOOKIES, DIALOG_STYLE_MSGBOX, "Cookies Statistic",str,"OK","");
   }
   }
   }
   return 1;
}
When I make /getcookies 10000000000 it show the usage.
What is the problem?
Reply
#2

The "u" specifier is used for IDs. Try with "i" instead.
Edit if you are trying to see someone's cookies, the id should be under the connected players' count.
Reply
#3

I use it for id
Reply
#4

Then the usage is /getcookies 0 to see your cookies.
@Konstantinos: Is the GiveID a global variable? Conflicts may appear...
Reply
#5

Its wont work
Reply
#6

MAX_PLAYERS can be even 1000, but not 10000000000.

By the way, opening braces like that is pointless.
pawn Код:
CMD:getcookies(playerid, params[])
{
    new ID;
    if(sscanf(params, "r", ID)) return SendClientMessage(playerid, RED, "USAGE: /getcookies [Name/ID]");
    if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "ERROR: Player is not connected");
    if(ID == playerid) SendClientMessage(playerid, RED, "ERROR: You can check your own cookies using /mycookies");
    new str[64],name2[MAX_PLAYER_NAME];
    GetPlayerName(ID, name2, MAX_PLAYER_NAME);
    format(str, sizeof(str), "Name : %s\n Cookies\n%d", name2, pInfo[ID][COOKIES]);
    ShowPlayerDialog(playerid, D_GETCOOKIES, DIALOG_STYLE_MSGBOX, "Cookies Statistic",str,"OK","");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)