Simple problem
#1

I know this will be solved within a second but im trying to make a /win cmd where you type /win (id) (prize)
So /win 1 dildo
It wont give them the prize but it announces it to all the players it did

pawn Код:
CMD:win(playerid, params[])
{
if(!IsPlayerLuxAdmin(playerid))
    {
        return SendClientMessage(playerid, -1, "SERVER: Unknown Command.");
    }
    else
    {
        new id, name[MAX_PLAYER_NAME],str[128],string[128];
        if(sscanf(params, "u", id, string)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /win <id> <prize>");
        GetPlayerName(id, name, sizeof(name));
        format(str,sizeof(str), "~R~%s ~w~has won the event~n~and %s",name,string);
        GameTextForAll(str,6000,3);
    }
return 1;
}
its showing like this
http://i.imgur.com/FkI3f.png
http://i.imgur.com/12oop.png
Reply
#2

pawn Код:
CMD:win(playerid, params[])
{
    if(!IsPlayerLuxAdmin(playerid))
    {
        return SendClientMessage(playerid, -1, "SERVER: Unknown Command.");
    }
    else
    {
        new id, name[MAX_PLAYER_NAME],str[128],string[32];
        if(sscanf(params, "us[32]", id, string)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /win <id> <prize>");
        GetPlayerName(id, name, sizeof(name));
        format(str,sizeof(str), "~R~%s ~w~has won the event~n~and %s",name,string);
        GameTextForAll(str,6000,3);
    }
    return 1;
}
You forgot to add the string(s[32] too
pawn Код:
f(sscanf(params, "us[32]", id, string)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /win <id>
Also 128 string is too big, so I decreased it to 32.
Reply
#3

Thansks.. +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)