You can can't use this command ?!! - 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)
+--- Thread: You can can't use this command ?!! (
/showthread.php?tid=557879)
You can can't use this command ?!! -
nezo2001 - 15.01.2015
I have this command
PHP код:
CMD:car(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
new carid, color1, color2;
new Float:x, Float:y, Float:z;
new Float:health;
if(sscanf(params, "ddd", carid, color1, color2)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /car [id] (Color 1) (Color 2)");
if(carid < 411 || carid > 611) return SendClientMessage(playerid, COLOR_RED, "Car id can't be less than 411 or more than 611");
GetPlayerPos(playerid, x, y, z);
new car = CreateVehicle(carid, x+3, y, z, color1, color2, -1);
new interior = GetPlayerInterior(playerid);
LinkVehicleToInterior(car, interior);
new world = GetPlayerVirtualWorld(playerid);
SetVehicleVirtualWorld(car, world);
GetVehicleHealth(car, health);
if(health == 0)
{
DestroyVehicle(car);
}
SendClientMessage(playerid, COLOR_BROWN, "Vehcile Spawned");
return 1;
}
And when i use it it give me "You can't use this command"
but when i see my admin level it is equal 5
so what ?
Respuesta: You can can't use this command ?!! -
JuanStone - 15.01.2015
That happens because it has a condition if it is level 2 or greater will return to the message, otherwise function, you must do the following, this will allow use to anyone with the variable administrator in 1 or more.
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
Edit:
Quote:
Originally Posted by nezo2001
lol i slept 5 hours only today
|
That ? Lol.
Re: You can can't use this command ?!! -
nezo2001 - 15.01.2015
lol i slept 5 hours only today