invalid player id
#1

hey guys, i'm making a command that shows how noob a player is in percentage.
it's just a random command that is used for fun.

command: /hownoob -id-

in chat: OMG! Player(1) is 94 Percent Noob!


I have ran into a little problem though, if I put in an invalid id, it says: OMG! (65535) is 10 Percent Noob!

i'm pretty sure i've made it so that if an invalid id is used, it should send back an error message, but that doesnt seem to be the case, also i get sscanf invalid parameter errors in my server console :/

here is my code

PHP код:
CMD:hownoob(playeridparams[])
{
    new 
pname[MAX_PLAYER_NAME];
    new 
noob random(101);
    new 
string[64];
    if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridRED"Invalid ID.");
    if(
sscanf(params"us[128]"playerid)) return SendClientMessage(playeridRED"Syntax: /hownoob (id)");
    if(
GetPVarInt(playerid,"HOWNOOB_TIMER")>GetTickCount())return SendClientMessage(playerid,0xFFFFFFFF,"Please Wait Before Being Noob Again!");
    
SetPVarInt(playerid,"HOWNOOB_TIMER",GetTickCount()+60000);
    
GetPlayerName(playeridpnamesizeof(pname));
    
format(stringsizeof(string), "OMG! %s(%d) is %i Percent Noob!"pnameplayeridnoob);
    
SendClientMessageToAll(PINKstring);
    return 
1;

Reply


Messages In This Thread
invalid player id - by tommzy09 - 16.08.2014, 07:31
Re: invalid player id - by Affan - 16.08.2014, 07:38
Re: invalid player id - by tommzy09 - 16.08.2014, 08:02
Re: invalid player id - by Affan - 16.08.2014, 08:08
Re: invalid player id - by tommzy09 - 16.08.2014, 08:21
Re: invalid player id - by Stinged - 16.08.2014, 08:21
Re: invalid player id - by DobbysGamertag - 16.08.2014, 08:25
Re: invalid player id - by tommzy09 - 16.08.2014, 08:29

Forum Jump:


Users browsing this thread: 1 Guest(s)