Command Warnings - 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: Command Warnings (
/showthread.php?tid=443612)
Command Warnings -
San1 - 12.06.2013
Код:
C:\Documents and Settings\Adrian\My Documents\World Wide Roleplay\gamemodes\WW-RP.pwn(702) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Adrian\My Documents\World Wide Roleplay\gamemodes\WW-RP.pwn(702) : warning 202: number of arguments does not match definition
CMD:
pawn Код:
CMD:setvw(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, COLOR_RED, "You are not authorized to use this command");
new targetid, vw, string[128];
if(sscanf(params, "ud", targetid, vw)) return SendClientMessage(playerid, COLOR_FADE1, "USAGE:/setvw [playerid] [virtual world]");
if(IsPlayerConnected(targetid))
{
PlayerInfo[targetid][pVW] = vw;
SetPlayerVirtualWorld(targetid, vw);
format(string, sizeof(string), "You have set %s's virtual world to %d.", GetPlayerName(targetid), vw);//Line 702
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
Re: Command Warnings -
ReVo_ - 12.06.2013
GetPlayerName returns the player name as reference.
Код:
new pname [24];
GetPlayerName(targetid, pname, 24);
format(string, sizeof(string), "You have set %s's virtual world to %d.", pname, vw);//Line 702
Respuesta: Command Warnings -
JustBored - 12.06.2013
pawn Код:
CMD:setvw(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, COLOR_RED, "You are not authorized to use this command");
new targetid, vw, string[128];
if(sscanf(params, "ud", targetid, vw)) return SendClientMessage(playerid, COLOR_FADE1, "USAGE:/setvw [playerid] [virtual world]");
if(IsPlayerConnected(targetid))
{
PlayerInfo[targetid][pVW] = vw;
SetPlayerVirtualWorld(targetid, vw);
new pName[24];
GetPlayerName(targetid, pName, 24);
format(string, sizeof(string), "You have set %s's virtual world to %d.", pName, vw);//Line 702
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}