command help
#2

PHP код:
CMD:ar(playeridparams[])
{
//    Check if air recon is already online then send error message
    
if(GetPVarInt(playerid,"AirReconOnline"))return SendClientMessage(playerid,COLOR_RED,"ERROR: You have already set the Air Recon Online!");
    if(
gTeam[playerid] == TEAM_Internationalforces)
    {
        
SendClientMessage(playerid,COLOR_BLUE,"i need air recon online!");
        
SendClientMessage(playerid,COLOR_BLUE,"copy that we are coming to your position in 2 sec!");
        
SendClientMessage(playerid,COLOR_RED,"You lost $90000 for air recon.");
        
TogglePlayerControllable(playerid0);
        new 
Float:vFloat:cFloat:r;
        
GetPlayerPos(playeridvcr);
        
SetPlayerCameraPos(playeridvcr+30);
        
SetPlayerCameraLookAt(playeridvcr);
        
SetTimer("endar"60000false);
        
GivePlayerMoney(playerid, -90000);
        
SetPVarInt(playerid,"AirReconOnline",true); //Set it online in a pvar
        
return SendClientMessage(playerid,COLOR_BLUE,"We are in your position you can use Satellite!");
      }
     if(
gTeam[playerid] != TEAM_Internationalforces) return SendClientMessage(playerid,COLOR_RED,"ERROR: Your team dosent have Satellite!");
     return 
1;
}
CMD:endar(playeridparams[])
{
// Check if Air Recon is not online Then send error message
    
if(!GetPVarInt(playerid,"AirReconOnline"))return SendClientMessage(playerid,COLOR_RED,"ERROR: You have not set the Air Recon Online first!");
    
SetCameraBehindPlayer(playerid);
    
TogglePlayerControllable(playerid1);
    
DeletePVar(playerid,"AirReconOnline"); // After starting it delete it so one cannot spam it twice or thrice
    
return 1;

Reply


Messages In This Thread
command help - by GeneralAref - 02.12.2015, 06:48
Re: command help - by gurmani11 - 02.12.2015, 07:56
Re: command help - by GeneralAref - 02.12.2015, 08:19
Re: command help - by GeneralAref - 02.12.2015, 08:29
Re: command help - by gurmani11 - 02.12.2015, 09:18
Re: command help - by GeneralAref - 02.12.2015, 10:51
Re: command help - by GeneralAref - 02.12.2015, 13:21

Forum Jump:


Users browsing this thread: 1 Guest(s)