Problem
#1

Hey guys, I got a problem.
Like i want to do: (example)
pawn Код:
dcmd_agoto(playerid,params[])
{
    new id,Float:x,Float:y,Float:z,string[128];
    CheckLvl(playerid,3);
    if(sscanf(params,"u",id)) return SHM(playerid,"/agoto <playerid / name>","Will teleport yourself to the player specified!");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
    GetPlayerPos(id,x,y,z);
    SetPlayerInterior(playerid,GetPlayerInterior(id));
    if(!IsPlayerInAnyVehicle(playerid))
    {
        SetPlayerPos(playerid,x+2,y,z);
    }
    else
    {
        SetVehiclePos(GetPlayerVehicleID(playerid),x+2,y,z);
        PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid),0);
    }
    format(string,sizeof(string),"» You have successfully teleported to "lyellow2"%s(ID:%d)"lgreen2"!",GetPName(id),id);
    SendClientMessage(playerid,green2,string);
    return 1;
}
That CheckLvl(playerid,3); is if his level is < 3 then return a message, i have on this public.
But even if he's level 0, it still lets him use it. Why?
pawn Код:
forward CheckLvl(playerid,levelo);
public CheckLvl(playerid,levelo)
{
    new string[165];
    format(string,sizeof(string),"ERROR: You need level "lorange"%i"lwhite" to use this command!",levelo);
    if(PInfo[playerid][Level] < levelo) return SendClientMessage(playerid,white,string);
    return 0;
}
Reply


Messages In This Thread
Problem - by [MWR]Blood - 27.07.2011, 08:25
Re: Problem - by Jeffry - 27.07.2011, 09:51
Re: Problem - by [MWR]Blood - 27.07.2011, 15:15
Re: Problem - by Jeffry - 27.07.2011, 15:57
Re: Problem - by [MWR]Blood - 27.07.2011, 19:17
Re: Problem - by Jeffry - 28.07.2011, 08:43

Forum Jump:


Users browsing this thread: 2 Guest(s)