SA-MP Forums Archive
lil help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: lil help (/showthread.php?tid=241729)



lil help - tanush - 18.03.2011

Well when i createorg and set someone leader it says "that user is not connected"
pawn Код:
CMD:createlaw1(playerid, params[])
{
    new str[500],wep1,wep2,wep3,id, ammo, name;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command.");
    if(sscanf(params,"uiiiis", id,wep1,wep2,wep3,ammo,name)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /createlaw1 [id] [wep1] [wep2] [wep3] [ammo] [name]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"That user is not connected.");
    if(wep1 > 0 && wep1 < 36)
    if(wep2 > 0 && wep2 < 36)
    if(wep3 > 0 && wep3 < 36)
    {
        if(ammo > 0 && ammo < 5000)
        {
            format(str, sizeof(str), "An Admin has set you the leader of %s",str);
            SendClientMessage(id,0xFF9900AA, str);
            IsLaw[id] = 1;
            Member[id] = 1;
            Leader[id] = 1;
            IsInOrg[id] = 1;
            GivePlayerWeapon(id,wep1, ammo);
            GivePlayerWeapon(id,wep2, ammo);
            GivePlayerWeapon(id,wep3, ammo);
            return 1;
        }
        else
        {
            SendClientMessage(playerid,0xFF0000FF, "Ammo meet be between 0 And 5000.");
        }
    }
    else
    {
        SendClientMessage(playerid,0xFF0000FF, "Invalid Weapon ID!");
    }
    return 1;
}



Re: lil help - Roomeo - 18.03.2011

One Problem
pawn Код:
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"That user is not connected.");
You can See you maded it If player is Connected Send The Message That User Is Not Connected Fix It T_T


Re: lil help - xir - 18.03.2011

You should use this with sscanf

pawn Код:
if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");
instead of IsPlayerConnected


Re: lil help - tanush - 18.03.2011

oh lawl thanks