Need help with scripting something
#8

pawn Код:
//#define FILTERSCRIPT remove // if this is a fs
       #include <a_samp>
       #include <streamer>

       forward OnPlayerEnterDynamicCP(playerid,checkpointid);

       new cp; //at the top of your script
       
     public OnGameModeInit()
    {
            return 1;
    }
    public OnGameModeExit()
    {
         return 1;
    }
 
   //filterscripts
     public OnFilterScriptInit()
    {
           cp = CreateDynamicCP(1520.9996,-1474.4762,9.5000,5,_,_,_,300); //under OnGameModeInit()
     }
        public OnFilterScriptExit()
        {
       }

     public OnPlayerEnterDynamicCP(playerid,checkpointid)//Create a new callback in your script.
    {
            if(checkpointid == cp)
    {
        RepairVehicle(GetPlayerVehicleID(playerid));
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREEN, "You are not in a vehicle!");
       if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid,COLOR_GREEN,"You don't have enough money!!");
        SendClientMessage(playerid, COLOR_PURPLE, "You repaired the vehicle");
       if(!IsPlayerInRangeOfPoint(playerid,10, 1520.9996,-1474.4762,9.5000 ) return SendClientMessage(playerid,COLOR_GREEN,"You must be at garage to use this ( if don't know where a checkpoint had been setted on your map with red!");
        GivePlayerMoney(playerid, -100);
        SendClientMessage(playerid, COLOR_YELLOW, "The repair costed you 100 dollars");
        PlayerPlaySound(playerid, 1133, 0, 0, 0);
       }
    }
Reply


Messages In This Thread
Need help with scripting something - by Songason - 19.07.2012, 16:19
Re: Need help with scripting something - by [KHK]Khalid - 19.07.2012, 16:29
Re: Need help with scripting something - by Songason - 19.07.2012, 16:34
Re: Need help with scripting something - by Songason - 19.07.2012, 16:46
Re: Need help with scripting something - by newbienoob - 19.07.2012, 17:02
Re: Need help with scripting something - by Songason - 19.07.2012, 17:05
Re: Need help with scripting something - by Songason - 19.07.2012, 17:35
Re: Need help with scripting something - by XStormiest - 19.07.2012, 17:47
Re: Need help with scripting something - by Songason - 19.07.2012, 19:26
Re: Need help with scripting something - by Songason - 19.07.2012, 21:15

Forum Jump:


Users browsing this thread: 1 Guest(s)