sscanf problem with users (u)
#1

I've got a 0.3c R5 server, and I was using sscanf(1) before, and then I decided to see if sscanf2 would fix it but it didn't. I've got this code:
pawn Код:
dcmd_givehticket(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "* Your not authorized to use that command !");
    new target;
    if(sscanf(params, "u", target)) return SendClientMessage(playerid, COLOR_GREY, "* /givehticket [Part of Name/PlayerID]");
    if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_GREY, "* Invalid User ID !");
    PlayerInfo[target][hTicket] = 1;
    SendClientMessage(target, COLOR_YELLOW, "* An admin has granted you a house ticket !");
    SendClientMessage(playerid, COLOR_GREY, "* You've granted the user a house ticket !");
    return 1;
}
Sometimes it gives the right user the house ticket, other times it doesn't. If I type the players name instead of the ID though, it never gives it to them.
Reply
#2

EDIT: You useing the stock version or the plugin?
Reply
#3

did you downlaod the sscanf version from the thread that says it works for rc5?
Reply
#4

Yeah dowster, I did.
Reply
#5

hmm.. well i was just on a server with this problem, i guess you should just switch the u parameter to an integer for now, and make sure the people using the command know to only input a player id and not a name, unless someone else knows how to fix this.
Reply
#6

Quote:
Originally Posted by dowster
Посмотреть сообщение
hmm.. well i was just on a server with this problem, i guess you should just switch the u parameter to an integer for now, and make sure the people using the command know to only input a player id and not a name, unless someone else knows how to fix this.
Hm I guess I'll have to try that, thanks.
Reply
#7

There is nothing wrong with your script. I think this has something to do with the plugin itself. You should check the following:

1. Make sure you have the .dll file in the plugins directory on Windows, and the .so file on Linux.
2. Also make sure you have the function included at the top of your script: "#include <sscanf2>"

The code you are using works perfectly fine for me.
Reply
#8

Update your sscanf plugin (old one is not working with 0.3c R5)
Reply
#9

Quote:
Originally Posted by dowster
Посмотреть сообщение
did you downlaod the sscanf version from the thread that says it works for rc5?
Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Yeah dowster, I did.
Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
Update your sscanf plugin (old one is not working with 0.3c R5)
He did. Or you forgot one of them (plugin/include) ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)