17.10.2014, 05:41
You missed some parameters for GetPlayerName,
Syntax can be found here: https://sampwiki.blast.hk/wiki/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;
}