16.09.2017, 21:01
Hey ! can you fix me this problem with flymode? i can activate it but i cant deactivate it
CMD:flymode(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new sendername[30],string[256];
if(flymode[playerid] == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
flymode[playerid] = 1;
format(string,sizeof(string),"%s a activat comanda /flymode.", sendername);
InitFly(playerid);
StartFly(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
else
{
GetPlayerName(playerid, sendername, sizeof(sendername));
flymode[playerid] = 0;
format(string,sizeof(string),"%s a dezactivat comanda /flymode.", sendername);
StopFly(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
}
ABroadCast(COLOR_YELLOW,string,1);
}
else return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
}
return 1;
}
please help if you know how to fix
CMD:flymode(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new sendername[30],string[256];
if(flymode[playerid] == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
flymode[playerid] = 1;
format(string,sizeof(string),"%s a activat comanda /flymode.", sendername);
InitFly(playerid);
StartFly(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
else
{
GetPlayerName(playerid, sendername, sizeof(sendername));
flymode[playerid] = 0;
format(string,sizeof(string),"%s a dezactivat comanda /flymode.", sendername);
StopFly(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
}
ABroadCast(COLOR_YELLOW,string,1);
}
else return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
}
return 1;
}
please help if you know how to fix