SA-MP Forums Archive
/setvw with sscanf 2.0 problem. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /setvw with sscanf 2.0 problem. (/showthread.php?tid=309284)



/setvw with sscanf 2.0 problem. - ReneG - 07.01.2012

I am currently learning how to use sccanf and decided I would try and make a "/setvw [playerid] [worldid]" command. I've tried just about everything, but I don't know what I'm missing. My script has no errors on compiling, but IG my command doesn't work.

pawn Код:
CMD:setvw(playerid,params[])
{
    new vw, id;
   
    if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: Unknown command");
    if (sscanf(params, "u", id, vw)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /setvw [playerid] [virtualworld]");
    if (vw > 2000) return SendClientMessage(playerid, COLOR_WHITE, "Must not exceed 2000");
    else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_CRIMSON, "Player not found.");
     
   
    else
    {
        SetPlayerVirtualWorld(id,vw);
        return 1;
    }
}
Can someone tell me what I'm doing wrong?


Re: /setvw with sscanf 2.0 problem. - Richie - 07.01.2012

pawn Код:
if(sscanf(params, "ui", id, vw))



Re: /setvw with sscanf 2.0 problem. - ReneG - 07.01.2012

Thanks bro. Repped.