06.01.2015, 02:25
fiz isso aqui rбpido, mais nгo й funcional, afs..
pawn Код:
if(strcmp(cmd, "/checkweapons", true) == 0 || strcmp(cmd, "/checkw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gLogged[playerid] == 1)
{
if (PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1,"ERRO: You are not authorized");
return true;
}
if(PlayerInfo[playerid][pAdminStats] != 0)
{
SendClientMessage(playerid,COLOR_GRAD1,"ERRO: Vocк nгo estб no modo admin! (/trabalhar)");
return true;
}
temp = strtok(cmdtext,idx);
if (!strlen(temp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USE: /checkweapons [ID/Nome]");
return true;
}
targetid = ReturnUser(temp);
if (targetid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_ERROR, "That player is offline");
return true;
}
new weaponsmodel, ammunition;
GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
format(string, sizeof(string), "%s has the following weapons:", pNameGive);
SendClientMessage(playerid, COLOR_ADMIN_INFO, string);
for (new i=0; i<9; i++)
{
GetPlayerWeaponData(targetid, i, weaponsmodel, ammunition);
if(weaponsmodel != 0)
{
format(string, sizeof(string), "%d: %d (%d)", i, weaponsmodel, ammunition);
SendClientMessage(playerid, COLOR_ADMIN_INFO, string);
}
}
}
}
return true;
}