07.01.2012, 01:57
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.
Can someone tell me what I'm doing wrong?
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;
}
}