CMD:handsup(playerid, params[])
{
if(GetPlayerState(playerid) != 1 && GetPlayerState(playerid) != 2 && GetPlayerState(playerid) != 3 && GetPlayerState(playerid) != 7)
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED, "[Error]: You cannot use animations while in the vehicle!");
return SendClientMessage(playerid, COLOR_RED, "[Spawned]: You must be spawned, To use this command!");
if(pInfo[playerid][Freeze] == 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: You are frozen, Cannot use this command!");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
SendAdminCMD(playerid, "handsup");
return 1;
}
Every "if" must be followed either by "return" or by { }. Your 1st if has neither of them.
|
Every "if" must be followed either by "return" or by { }. Your 1st if has neither of them.
|
//If it's only one function
if(Something) ThisOneFunction();
if(Something)
ThisOneFunction();
//If it's more than one
if(Something)
{
ThisOneFunction();
ThisOtherFunction();
}
if(Something) {
ThisOneFunction();
ThisOtherFunction();
}
if(Something) { ThisOneFunction(); ThisOtherFunction(); }
CMD:handsup(playerid, params[]) { if(GetPlayerState(playerid) != 1 && GetPlayerState(playerid) != 2 && GetPlayerState(playerid) != 3 && GetPlayerState(playerid) != 7) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED, "[Error]: You cannot use animations while in the vehicle!"); return SendClientMessage(playerid, COLOR_RED, "[Spawned]: You must be spawned, To use this command!"); } if(pInfo[playerid][Freeze] == 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: You are frozen, Cannot use this command!"); SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP); SendAdminCMD(playerid, "handsup"); return 1; }
CMD:handsup(playerid, params[])
{
if (GetPlayerState(playerid) != 1 && GetPlayerState(playerid) != 2 && GetPlayerState(playerid) != 3 && GetPlayerState(playerid) != 7)
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return SendClientMessage(playerid, COLOR_RED, "[Error]: You cannot use animations while in the vehicle!");
}
}
return SendClientMessage(playerid, COLOR_RED, "[Spawned]: You must be spawned, To use this command!");
if (pInfo[playerid][Freeze] == 1)
{
return SendClientMessage(playerid, COLOR_RED, "[Error]: You are frozen, Cannot use this command!");
}
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
SendAdminCMD(playerid, "handsup");
return 1;
}