Is there a way to do this without a string?
#10

Yes, this is what i have

pawn Код:
CMD:givecash(playerid,params[])
{
    new
        id,
        amount;
    if(sscanf(params, "ud", id, amount)) SendClientMessage(playerid,COLOR_RED,"Usage: /givecash <ID> <Amount>");
    else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Player Not Connected!");
    else
    {
        new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        GetPlayerName(id, PlayerName, sizeof(PlayerName));
        GivePlayerMoney(id,amount);
        new str[40+MAX_PLAYER_NAME];
        format(str, sizeof(str), "You have sent %d to %s",amount,PlayerName);
        SendClientMessage(playerid, COLOR_GREEN, str);
        format(str, sizeof(str), "You have recieved %d from %s",amount,name);
        SendClientMessage(id, COLOR_GREEN, str);
    }
    return 1;
}
And it works :]
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)