/setvw with sscanf 2.0 problem.
#1

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?
Reply
#2

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

Thanks bro. Repped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)