Problem with this 2 cmds
#1

Hello guys,i've coded this commands and both have same problem.It works only for ID 0,what's wrong?SSCANF is updated.

pawn Код:
CMD:gall(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 2)
    {
    new Float:x;
    new Float:y;
    new Float:z;
    new targetid;
    new string[130];
    for(new i=0; i<MAX_PLAYERS; i++)
    if(IsPlayerConnected(i)) {
    GetPlayerPos(playerid,x,y,z);
    SetPlayerPos(i,x,y,z+10);
    new pName[24];
    GetPlayerName(targetid,pName,128);
    format(string, sizeof(string), "Admin %s (%d) has teleported all players to his location.",pName,targetid);
    SendClientMessageToAll(red,string);
    }
    return true;
    }
    else return 0;
}

CMD:info(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    new string[256], giveplayerid;
    new Float:gihp, Float:giar;
    GetPlayerHealth(giveplayerid, gihp);
    GetPlayerArmour(giveplayerid, giar);
    GetPlayerName(giveplayerid,string,sizeof(string));
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /info [ID/PartOfName]");
    if(IsPlayerConnected(giveplayerid))
    {
        format(string, sizeof(string), "Cash: %i$ - Current Wanted Level: %d - Admin Level: %d - Kills: %i - Deaths: %i - Health: %0.1f - Armour: %0.1f -",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pWantedLevel],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],gihp,giar);
        SendClientMessage(playerid, yellow, string);
    }
    else
    {
        SendClientMessage(playerid, red, "Invalid player specified.");
    }
    return true;
    }
    else return 0;
}
Reply


Messages In This Thread
Problem with this 2 cmds - by Face9000 - 23.03.2012, 16:48
Re: Problem with this 2 cmds - by park4bmx - 23.03.2012, 16:52
Re: Problem with this 2 cmds - by BigD - 23.03.2012, 16:53
Re: Problem with this 2 cmds - by Face9000 - 23.03.2012, 18:15

Forum Jump:


Users browsing this thread: 1 Guest(s)