20.09.2011, 03:39
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:
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.
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;
}