Why this ? warning 202 -
roderjit - 17.10.2014
Код:
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(183) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(183) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(183) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(183) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(188) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(188) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(191) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(191) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(196) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(196) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(199) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(199) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(203) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(203) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(203) : warning 202: number of arguments does not match definition
C:\Users\Tronic\Desktop\NUEVO\gamemodes\NapsixRoleplay.pwn(203) : warning 202: number of arguments does not match definition
CODE:
pawn Код:
CMD:makeadmin(playerid, params[])
{
new string[128];
if(Info[playerid][pAdmin] < 10) return NoAutorizado
new iLevel, iTarget;
if(sscanf(params, "ud", iTarget, iLevel)) return SendClientMessage(playerid, -1, "USO: /makeadmin [playerid] [Nivel]");
if(IsPlayerConnected(iTarget))
{
if(iLevel > 10)
{
format(string, sizeof(string), "[Napsix RP]: %s ha intentado dar un nivel de admin no permitido a %s", GetPlayerName(playerid), GetPlayerName(iTarget));
return 1;
}
if(Info[playerid][pAdmin] < iLevel)
{
format(string, sizeof(string), "El administrador %s te ha dado admin nivel: %d.", GetPlayerName(playerid), iLevel);
SendClientMessage(iTarget, -1, string);
format(string, sizeof(string), "Has dado admin nivel %d al jugador %s.", iLevel, GetPlayerName(iTarget));
SendClientMessage(playerid, -1, string);
}
else
{
format(string, sizeof(string), "El administrador %s te descendido a admin nivel %d.", GetPlayerName(iTarget), iLevel);
SendClientMessage(iTarget, -1, string);
format(string, sizeof(string), "Has descendido a %s a admin nivel %d", GetPlayerName(iTarget), iLevel);
SendClientMessage(playerid, -1, string);
}
Info[iTarget][pAdmin] = iLevel;
format(string, sizeof(string), "El administrador %s le diу admin nivel %d a: %s", GetPlayerName(playerid), iLevel, GetPlayerName(iTarget));
}
else SendClientMessage(playerid, -1, "Ese jugador no estб conectado.");
return 1;
}
Line 183:
pawn Код:
format(string, sizeof(string), "[Napsix RP]: %s ha intentado dar un nivel de admin no permitido a %s", GetPlayerName(playerid), GetPlayerName(iTarget));
Line 188:
pawn Код:
format(string, sizeof(string), "El administrador %s te ha dado admin nivel: %d.", GetPlayerName(playerid), iLevel);
Line 191:
pawn Код:
format(string, sizeof(string), "Has dado admin nivel %d al jugador %s.", iLevel, GetPlayerName(iTarget));
Line 196:
pawn Код:
format(string, sizeof(string), "El administrador %s te descendido a admin nivel %d.", GetPlayerName(iTarget), iLevel);
Line 199:
pawn Код:
format(string, sizeof(string), "Has descendido a %s a admin nivel %d", GetPlayerName(iTarget), iLevel);
Line 203:
pawn Код:
format(string, sizeof(string), "El administrador %s le diу admin nivel %d a: %s", GetPlayerName(playerid), iLevel, GetPlayerName(iTarget));
P.S.: Ignore Language..
Re: Why this ? warning 202 -
RoboN1X - 17.10.2014
You missed some parameters for GetPlayerName,
Syntax can be found here:
https://sampwiki.blast.hk/wiki/GetPlayerName
pawn Код:
CMD:makeadmin(playerid, params[])
{
new string[128];
if(Info[playerid][pAdmin] < 10) return NoAutorizado
new iLevel, iTarget;
if(sscanf(params, "ud", iTarget, iLevel)) return SendClientMessage(playerid, -1, "USO: /makeadmin [playerid] [Nivel]");
if(IsPlayerConnected(iTarget))
{
new pName[MAX_PLAYER_NAME+1], tName[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(iTarget, tName, sizeof(tName));
if(iLevel > 10)
{
format(string, sizeof(string), "[Napsix RP]: %s ha intentado dar un nivel de admin no permitido a %s", pName, tName);
return 1;
}
if(Info[playerid][pAdmin] < iLevel)
{
format(string, sizeof(string), "El administrador %s te ha dado admin nivel: %d.", pName, iLevel);
SendClientMessage(iTarget, -1, string);
format(string, sizeof(string), "Has dado admin nivel %d al jugador %s.", iLevel, tName);
SendClientMessage(playerid, -1, string);
}
else
{
format(string, sizeof(string), "El administrador %s te descendido a admin nivel %d.", tName, iLevel);
SendClientMessage(iTarget, -1, string);
format(string, sizeof(string), "Has descendido a %s a admin nivel %d", tName, iLevel);
SendClientMessage(playerid, -1, string);
}
Info[iTarget][pAdmin] = iLevel;
format(string, sizeof(string), "El administrador %s le diу admin nivel %d a: %s", pName, iLevel, tName);
}
else SendClientMessage(playerid, -1, "Ese jugador no estб conectado.");
return 1;
}
Respuesta: Why this ? warning 202 -
roderjit - 17.10.2014
Thx, works perfectly