/set command - "SERVER: Unknown Message" (Help)
#10

Quote:
Originally Posted by Simon
Посмотреть сообщение
He is using sscanf. Your first problem is here:

pawn Код:
new aitem; // cell, but you're trying to put a string in it!
    new id;
    new amount;
    if(PlayerInfo[playerid][AdminLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(sscanf(params,"sud",aitem,id,amount)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /set (/help sets) (ID/Partial Name) (Amount/Level/Faction)"); // your sscanf line is putting a string in the cell.
    new item[128];
    format(item,sizeof(item),"%s",aitem); // now you're putting this cell in a string array, your data is lost.
pawn Код:
new item[128]; // create a string array
    new id;
    new amount;
    if(PlayerInfo[playerid][AdminLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(sscanf(params,"sud",item,id,amount)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /set (/help sets) (ID/Partial Name) (Amount/Level/Faction)"); // put the first parameter directly into the string.
Oh, I'll check that
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)