Adding Checkpoint Sound?
#1

Hello,

I am scripting a pizza job for my server with my buddy, Blazed! I have used the SAMP - Tutorials and Wiki to somehow develop a minor script which was sort of based off of an abandoned script I found which was added and unfinished back in early 2011. I have tried adding checkpoint sounds but nothing seems to work.

Can someone maybe add them. You will get a (REP+1) if you are helpful.


PHP код:
#include <a_samp>
#define COLOR_DARKGOLD 0x808000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
new PizzaJob[256];
public 
OnFilterScriptInit()
{
    
AddStaticVehicle(448,1353.9001,238.8588,19.5669,40.4306,0,0); // Pizza 1
    
AddStaticVehicle(448,1355.6724,241.7024,19.5669,40.4306,0,0); // Pizza 1
    
AddStaticVehicle(448,1362.5547,257.8708,19.5669,30.0905,0,0); // Pizza 2
    
AddStaticVehicle(448,1364.3494,262.7186,19.5669,27.2704,0,0); // Pizza 3
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/pizzajob"cmdtexttrue10) == 0)
    {
        if(
IsPlayerInRangeOfPoint(playerid30.01361.2267,229.9569,19.5669))
        if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
        {
            
PizzaJob[playerid] = 1;
            new 
name[MAX_PLAYER_NAME], string[48];
            
GetPlayerName(playeridnamesizeof(name));
            
format(stringsizeof(string), "* %s is now a Pizzaboy."name );
            
SendClientMessageToAll(COLOR_YELLOWstring);
            
SetPlayerCheckpoint(playerid,1200.7805,246.8164,19.5547,10);
            
SendClientMessage(playerid,COLOR_YELLOW,"* Follow the built in GPS markers to find the pizza destionation!");
            return 
1;
        }
        
SendClientMessage(playeridCOLOR_RED,"Hop onto the pizza bike to start the pizza route!");
    }
    return 
0;
}
public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
     if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
     {
         
SendClientMessage(playeridCOLOR_RED"* You can start the pizza route by using /pizzajob");
     }
     return 
0;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
     if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
     {
        if(
PizzaJob[playerid] == 1){
            
PizzaJob[playerid] = 2;
            
SetPlayerCheckpoint(playerid,1200.7805,246.8164,19.5547,10);
            
SendClientMessage(playerid,COLOR_YELLOW,"* Deliver a pizza to all the houses! Then you will be rewarded!");
            return 
1;
         }
        if(
PizzaJob[playerid] == 2){
            
PizzaJob[playerid] = 3;
            
SetPlayerCheckpoint(playerid,807.4531,372.4268,19.3820,10);
            return 
1;
         }
        if(
PizzaJob[playerid] == 3){
            
PizzaJob[playerid] = 4;
            
SetPlayerCheckpoint(playerid,749.0499,258.3000,27.0859,10);
            return 
1;
         }
        if(
PizzaJob[playerid] == 4){
            
PizzaJob[playerid] = 5;
            
SetPlayerCheckpoint(playerid,248.2986,-31.9731,1.5781,10);
            return 
1;
         }
        if(
PizzaJob[playerid] == 5){
            
PizzaJob[playerid] = 6;
            
SetPlayerCheckpoint(playerid,251.4354,-287.8364,1.5836,10);
            return 
1;
         }
        if(
PizzaJob[playerid] == 6){
            
PizzaJob[playerid] = 7;
            
SetPlayerCheckpoint(playerid,745.2696,-554.4398,18.0129,10);
            return 
1;
         }
        if(
PizzaJob[playerid] == 7){
            
PizzaJob[playerid] = 8;
            
SetPlayerCheckpoint(playerid,794.0338,-507.9911,18.0129,10);
            return 
1;
         }
        if(
PizzaJob[playerid] == 8){
            
PizzaJob[playerid] = 9;
            
SetPlayerCheckpoint(playerid,1079.9202,-345.0044,73.9922,10);
            return 
1;
         }
        if(
PizzaJob[playerid] == 9){
            
PizzaJob[playerid] = 10;
            
SetPlayerCheckpoint(playerid,2236.6624,166.5144,28.1535,10);
            return 
1;
         }
        if(
PizzaJob[playerid] == 10){
            
PizzaJob[playerid] = 11;
            
SetPlayerCheckpoint(playerid,1361.2267,229.9569,19.5669,10);
            return 
1;
         }
        if(
PizzaJob[playerid] == 11){
            
PizzaJob[playerid] = 0;
            
DisablePlayerCheckpoint(playerid);
            
SendClientMessage(playerid,COLOR_RED,"* Montgomery Pizza Co. has payed you $737 for delivering their pizzas.");
            
GivePlayerMoney(playerid,737);
         }
     }
     return 
1;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
    if(
PizzaJob[playerid] > 0)
    {
        
PizzaJob[playerid] = 0;
        
SendClientMessage(playeridCOLOR_RED"* The pizza's have gotten cold and you failed to deliver them!");
        
DisablePlayerCheckpoint(playerid);
    }
}
//* Credit to Ryan39 and Blazed *// 
Reply
#2

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
     if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
     {
        if(
PizzaJob[playerid] == 1){
            
PizzaJob[playerid] = 2;
            
SetPlayerCheckpoint(playerid,1200.7805,246.8164,19.5547,10);
            
PlayerPlaySound(playerid11330.00.00.0);
            
SendClientMessage(playerid,COLOR_YELLOW,"* Deliver a pizza to all the houses! Then you will be rewarded!");
            return 
1;
         }
        if(
PizzaJob[playerid] == 2){
            
PizzaJob[playerid] = 3;
            
SetPlayerCheckpoint(playerid,807.4531,372.4268,19.3820,10);
            
PlayerPlaySound(playerid11330.00.00.0);
            return 
1;
         }
        if(
PizzaJob[playerid] == 3){
            
PizzaJob[playerid] = 4;
            
SetPlayerCheckpoint(playerid,749.0499,258.3000,27.0859,10);
            
PlayerPlaySound(playerid11330.00.00.0);
            return 
1;
         }
        if(
PizzaJob[playerid] == 4){
            
PizzaJob[playerid] = 5;
            
SetPlayerCheckpoint(playerid,248.2986,-31.9731,1.5781,10);
            
PlayerPlaySound(playerid11330.00.00.0);
            return 
1;
         }
        if(
PizzaJob[playerid] == 5){
            
PizzaJob[playerid] = 6;
            
SetPlayerCheckpoint(playerid,251.4354,-287.8364,1.5836,10);
            
PlayerPlaySound(playerid11330.00.00.0);
            return 
1;
         }
        if(
PizzaJob[playerid] == 6){
            
PizzaJob[playerid] = 7;
            
SetPlayerCheckpoint(playerid,745.2696,-554.4398,18.0129,10);
            
PlayerPlaySound(playerid11330.00.00.0);
            return 
1;
         }
        if(
PizzaJob[playerid] == 7){
            
PizzaJob[playerid] = 8;
            
SetPlayerCheckpoint(playerid,794.0338,-507.9911,18.0129,10);
            
PlayerPlaySound(playerid11330.00.00.0);
            return 
1;
         }
        if(
PizzaJob[playerid] == 8){
            
PizzaJob[playerid] = 9;
            
SetPlayerCheckpoint(playerid,1079.9202,-345.0044,73.9922,10);
            
PlayerPlaySound(playerid11330.00.00.0);
            return 
1;
         }
        if(
PizzaJob[playerid] == 9){
            
PizzaJob[playerid] = 10;
            
SetPlayerCheckpoint(playerid,2236.6624,166.5144,28.1535,10);
            
PlayerPlaySound(playerid11330.00.00.0);
            return 
1;
         }
        if(
PizzaJob[playerid] == 10){
            
PizzaJob[playerid] = 11;
            
SetPlayerCheckpoint(playerid,1361.2267,229.9569,19.5669,10);
            
PlayerPlaySound(playerid11330.00.00.0);
            return 
1;
         }
        if(
PizzaJob[playerid] == 11){
            
PizzaJob[playerid] = 0;
            
DisablePlayerCheckpoint(playerid);
            
SendClientMessage(playerid,COLOR_RED,"* Montgomery Pizza Co. has payed you $737 for delivering their pizzas.");
            
PlayerPlaySound(playerid11330.00.00.0);
            
GivePlayerMoney(playerid,737);
         }
     }
     return 
1;

There it is. It should work, although in the PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);, change the 1133 to whatever the sound ID is that you want.
Reply
#3

Rep+1 Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)