Back to scripting, errors -_-
#1

pawn Код:
new targetid,type,string[128];
    if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* This player is not in server..");
    if(type < 0 || type > 99999999) return SendClientMessage(playerid, COLOR_GREY, "* Cannot go under 0 or above 99999999.");
    if(PlayerInfo[playerid][pAdmin] < 10) return SendClientMessage(playerid, COLOR_GRAD1, "You are not ADMIN!");

    GivePlayerCash(targetid, type);
    format(string, sizeof(string),"AdmCmd: %s give player %s %d SAK", RPName( playerid ), RPName( targetid ), type);
    SendAdminMessage(COLOR_YELLOW,string);
    return 1;
Always shows * This player is not in server.. could some one pull the target id part, apart and explain to me whats going on?
Reply
#2

Your version of sscanf is the most up to date, verified working version right?
Reply
#3

I just put the new ones in there and now it just does /givemoney [playerid] [amount]
Reply
#4

Try making the others "else if"
Reply
#5

Quote:
Originally Posted by dowster
Посмотреть сообщение
Try making the others "else if"
pawn Код:
new targetid,type,string[128];
    if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: {FFFFFF}/givemoney [playerid] [amount]");
    else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* This player is not in server..");
    else if(type < 0 || type > 99999999) return SendClientMessage(playerid, COLOR_GREY, "* Cannot go under 0 or above 99999999.");
    else if(PlayerInfo[playerid][pAdmin] < 10) return SendClientMessage(playerid, COLOR_GRAD1, "You are not ADMIN!");
    else {
    GivePlayerCash(targetid, type);
    format(string, sizeof(string),"AdmCmd: %s give player %s %d SAK", RPName( playerid ), RPName( targetid ), type);
    SendAdminMessage(COLOR_YELLOW,string);
    return 1;
    }
Thanks mate, thats my new code Works +1 rep
Reply
#6

No problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)