public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/test", cmdtext, true, 12) == 0)
{
if(AirBreakVar[playerid] == 0)
{
if (!IsPlayerAdmin(playerid)) return SendClientMessage, 0xFF0000FF, "You're not authorized to use this Command");
if(IsPlayerInAnyVehicle(playerid) == 0)
{
AirBreakVar[playerid] = 1;
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, yellow, "Air Break on, /abset to change the move distance, /aboff to turn off");
}
else
{
SendClientMessage(playerid, red, "You can not activate Air Break when in a vehicle");
}
}
else
{
SendClientMessage(playerid, red, "Your Air Break is already on");
}
return 1;
}
if (!IsPlayerAdmin(playerid)) return SendClientMessage, 0xFF0000FF, "You're not authorized to use this Command");
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/test", true) == 0)
{
if(AirBreakVar[playerid] == 0)
{
if (!IsPlayerAdmin(playerid)) return SendClientMessage, 0xFF0000FF, "You're not authorized to use this Command");
if(IsPlayerInAnyVehicle(playerid) == 0)
{
AirBreakVar[playerid] = 1;
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, yellow, "Air Break on, /abset to change the move distance, /aboff to turn off");
}
else
{
SendClientMessage(playerid, red, "You can not activate Air Break when in a vehicle");
}
}
else
{
SendClientMessage(playerid, red, "Your Air Break is already on");
}
return 1;
}
PHP код:
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/test", cmdtext, true) == 0)
{
if(AirBreakVar[playerid] == 0)
{
if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You're not authorized to use this Command");
if(IsPlayerInAnyVehicle(playerid) == 0)
{
AirBreakVar[playerid] = 1;
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, yellow, "Air Break on, /abset to change the move distance, /aboff to turn off");
}
else
{
SendClientMessage(playerid, red, "You can not activate Air Break when in a vehicle");
}
}
else
{
SendClientMessage(playerid, red, "Your Air Break is already on");
}
return 1;
}
return 0;
}
Try removing the whole command, and compile, if it doesn't work, it means you're missing a bracket somewhere, if it works, its from the code, and I'll check it out and fix it for you.
|
if (!IsPlayerAdmin(playerid)) return SendClientMessage, 0xFF0000FF, "You're not authorized to use this Command");
if(!IsPlayerAdmin(playerid)) return SendClientMessage, 0xFF0000FF, "You're not authorized to use this Command");
if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000FF, "You're not authorized to use this Command");
Well since you didn't answer my question, I'm going to assume that this is the entire OnPlayerCommandText callback and you quite clearly forgot to close it off at the end, here is what you need to add:
pawn Код:
|