givegun and slap
#1

I have some problems with slap.. it doesnt show the meters..

here it is
pawn Код:
dcmd_slap(playerid,params[])
{
    if(!PLVL[playerid]) return 0;
    new pid;
    if(PlayerInfo[playerid][pAdminLevel] >=1)
    {
        if(sscanf(params, "u", pid)) return SendClientMessage(playerid, Yellow, "Usage: /slap <playerid>");
        if(IsPlayerConnected(pid))
        {
        new Float:Pos[3], string[128], adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], moneys = strval(params);
        GetPlayerPos(pid,Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(pid,Pos[0],Pos[1],Pos[2]+moneys);
        format(string, sizeof(string), "Admin %s has slapped %s for %d meters", adminname, paramname, moneys);
        MessageToAdmins(AdminColor, string);
        } else SendClientMessage(playerid, Red, "This player is not connected");
    } else if(PlayerInfo[playerid][pAdminLevel] == 0) return 0;
    return 1;
}
here is the givegun code, it says palyerisnot connected when i use my id also the gun name dont work

pawn Код:
dcmd_givegun(playerid, params[])
{
    if(!PLVL[playerid]) return 0;
    new id, gunid, ammo, gunname[50];
    new idx, String[128];
    String = strtok(params, idx);
    if(PlayerInfo[playerid][pAdminLevel] < 3) return 0;
    if(sscanf(params, "dsd", id, gunid, ammo)) return SendClientMessage(playerid, Yellow, "Usage: /givegun <playerid> <weaponid/name> <ammo>");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Red, "Player is not connected");
    if(gunid < 0 || gunid > 46) return SendClientMessage(playerid, Red, "Invalid weapon ID/name");
    GetWeaponModelIDFromName(String);
    if (!strlen(String))
    if (!strlen(params[idx+1]))
    GivePlayerWeapon(id, gunid, ammo);
    GetGunName(gunid, gunname, 50);
    format(String, 128, "Admin has given you a %s with %d bullets", gunname, ammo);
    SendClientMessage(id, AdminColor, String);
    return 1;
}
please help , i tried hard but still..
Reply


Messages In This Thread
givegun and slap - by xir - 11.01.2011, 19:07
Re: givegun and slap - by HyperZ - 11.01.2011, 19:14
Re: givegun and slap - by xir - 11.01.2011, 19:17
Re: givegun and slap - by xir - 12.01.2011, 11:58
Re: givegun and slap - by Outcast - 12.01.2011, 12:04
Re: givegun and slap - by HyperZ - 12.01.2011, 13:09
Re: givegun and slap - by xir - 12.01.2011, 16:29
Re: givegun and slap - by xir - 13.01.2011, 12:52
Re: givegun and slap - by Lorenc_ - 13.01.2011, 13:17
Re: givegun and slap - by xir - 13.01.2011, 13:22

Forum Jump:


Users browsing this thread: 5 Guest(s)