27.07.2011, 08:25
Hey guys, I got a problem.
Like i want to do: (example)
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?
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;
}
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;
}