CreateDynamicCp [REP++]
#1

I made this
PHP код:
CMD:pizza(playeridparams[])
{
    if(
PlayerInfo[playerid][pJob] != pizza) return SendClientMessage(playeridCOLOR_RED"You are not a part from pizza company");
    if(!
IsPlayerInVehicle(playeridpc1) && !IsPlayerInVehicle(playeridpc2) && !IsPlayerInVehicle(playeridpc3) && !IsPlayerInVehicle(playeridpc4) && !IsPlayerInVehicle(playeridpc5) && !IsPlayerInVehicle(playeridpc6) && !IsPlayerInVehicle(playeridpc7) && !IsPlayerInVehicle(playeridpc8)) return SendClientMessage(playeridCOLOR_RED"You are not in any pizza's company car !");
    
cp1 CreateDynamicCP(2148.9041,-1433.6654,25.5391,3, -1, -1playerid100.0);
    
i1 SetPlayerMapIcon(playerid12148.9041, -1433.665425.53910COLOR_REDMAPICON_GLOBAL);
    
SendClientMessage(playeridCOLOR_ORANGE"Go to the checkpoint and deliver the pizza");
    return 
1;

PHP код:
public OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == cp1)
    {
    
DestroyDynamicCP(cp1);
    
RemovePlayerMapIcon(playeridi1);
    
i2 SetPlayerMapIcon(playerid12380.4260,-1366.8895,24.00000COLOR_REDMAPICON_GLOBAL);
    
SendClientMessage(playeridCOLOR_ORANGE"Go to the next checkpoint");
    
cp2 CreateDynamicCP(2380.4260,-1366.8895,24.0000,3, -1, -1playerid100.0);
    }
    if(
checkpointid == cp2)
    {
    
DestroyDynamicCP(cp2);
    
RemovePlayerMapIcon(playeridi2);
    
i3 SetPlayerMapIcon(playerid12808.4329,-1189.1318,25.33880COLOR_REDMAPICON_GLOBAL);
    
cp3 CreateDynamicCP(2808.4329,-1189.1318,25.33803, -1, -1playerid100.0);
    
SendClientMessage(playeridCOLOR_ORANGE"Go to the next checkpoint");
    }
    if(
checkpointid == cp3)
    {
    
DestroyDynamicCP(cp3);
    
RemovePlayerMapIcon(playeridi3);
    
i4 SetPlayerMapIcon(playerid12487.9919,-1139.2998,38.43840COLOR_REDMAPICON_GLOBAL);
    
cp4 CreateDynamicCP(2487.9919,-1139.2998,38.43843, -1, -1playerid100.0);
    
SendClientMessage(playeridCOLOR_ORANGE"Go to the next checkpoint");
    }
    if(
checkpointid == cp4)
    {
    
DestroyDynamicCP(cp4);
    
RemovePlayerMapIcon(playeridi4);
    
i5 SetPlayerMapIcon(playerid11270.8938,-1156.5397,23.82810COLOR_REDMAPICON_GLOBAL);
    
cp5 CreateDynamicCP(1270.8938,-1156.5397,23.82813, -1, -1playerid100.0);
    
SendClientMessage(playeridCOLOR_ORANGE"Go to the next checkpoint");
    }
    if(
checkpointid == cp5)
    {
    
DestroyDynamicCP(cp5);
    
RemovePlayerMapIcon(playeridi5);
    
i6 SetPlayerMapIcon(playerid12099.3909,-1807.4417,13.10190COLOR_REDMAPICON_GLOBAL);
    
cp6 CreateDynamicCP(2099.3909,-1807.4417,13.10193, -1, -1playerid100.0);
    
SendClientMessage(playeridCOLOR_ORANGE"Now, Return back to the shop !");
    }
    if(
checkpointid == cp6)
    {
    
DestroyDynamicCP(cp6);
    
RemovePlayerMapIcon(playeridi6);
    
SendClientMessage(playeridCOLOR_RED"Good job, Now here is some moeny !");
    
GivePlayerMoney(playerid2000);
    }
    return 
1;

But when i enter one checkpoint it run all the codes that under the other checkpoints.
Please Help !
Reply


Messages In This Thread
CreateDynamicCp [REP++] - by nezo2001 - 28.01.2015, 19:04
Re: CreateDynamicCp [REP++] - by Sime30 - 28.01.2015, 19:12
Re: CreateDynamicCp [REP++] - by nezo2001 - 28.01.2015, 19:24
Re: CreateDynamicCp [REP++] - by Sime30 - 28.01.2015, 19:58
Re: CreateDynamicCp [REP++] - by M0HAMMAD - 28.01.2015, 21:15

Forum Jump:


Users browsing this thread: 4 Guest(s)