SA-MP Forums Archive
Problem With This... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem With This... (/showthread.php?tid=494546)



Problem With This... - Youssef214 - 13.02.2014

When I Try To Enter The DrugCPFinish it keeps sending me the messages that is on the DrugCP,What is the problem in this please?

pawn Код:
if(checkpointid == DrugCP)
    if(DrugDeliveryStart[playerid] == 0)
    {
       SendClientMessage(playerid, COLOR_RED, "You Are Not In A Drug Delivery Mission!");
    }
    else
    {
       new pID_name[MAX_PLAYER_NAME],Message[128];
       DestroyDynamicCP(DrugCP);
       SendClientMessage(playerid, 0xF79000FF, "You Have Now Took The Drugs,You Will Need To Go To The Car Icon On The Radar And You Will See The Checkpoint Go To It To Deliver The Drugs And Win 10K Money And 10 Scores.");
       SendClientMessage(playerid, COLOR_RED, "Warning: Players Will Come And Kill You Fast For 10K And 10 Scores Because You Are Delivering The Drugs.");
       RemovePlayerMapIcon( playerid, 0 );
       SetPlayerMapIcon(playerid, 1, 2351.8901,-1169.9969,28.0422, 55, 0, MAPICON_GLOBAL );
       DrugCPFinish = CreateDynamicCP(2351.8901,-1169.9969,28.0422, 2, -1, -1, -1, 100);
       GetPlayerName(playerid, pID_name, MAX_PLAYER_NAME);
       format(Message, sizeof(Message), "%s (%i) Has The Drugs! Kill Him To Get 10K Money And 10 Scores!",pID_name,playerid), SendClientMessageToAll(0xEFF700FF, Message);
       DrugsTaken[playerid] = 1;
       DrugsGetting[playerid] = 0;
    }
    else if(checkpointid == DrugCPFinish)
    if(DrugDeliveryStart[playerid] == 0)
    {
       SendClientMessage(playerid, COLOR_RED, "You Are Not In A Drug Delivery Mission!");
    }
    else
    {
       new pID_name[MAX_PLAYER_NAME],Message[128];
       DestroyDynamicCP(DrugCPFinish);
       SendClientMessage(playerid, 0xF79000FF, "Congratulations! You Have Delivered The Drugs! You Have Got 10K Money And 10 Scores!");
       SendClientMessage(playerid, 0xF79000FF, "Come Back If You Want More Money.");
       RemovePlayerMapIcon( playerid, 1 );
       GetPlayerName(playerid, pID_name, MAX_PLAYER_NAME);
       format(Message, sizeof(Message), "%s (%i) Has Delivered The Drugs! If You Killed Him You Won't Get The 10K Money And 10 Scores.",pID_name,playerid), SendClientMessageToAll(0xEFF700FF, Message);
       GameTextForPlayer(playerid, "Mission Completed", 5000, 5);
       DrugsTaken[playerid] = 0;
       DrugDeliveryStart[playerid] = 0;
    }
    return 1;
}



Re: Problem With This... - Youssef214 - 13.02.2014

anyone here?


Re: Problem With This... - Youssef214 - 14.02.2014

please you will get rep,please help me


Re: Problem With This... - Hostskool - 14.02.2014

Not sure but, try this.

pawn Код:
if(checkpointid == DrugCP)
{
    if(DrugDeliveryStart[playerid] == 0)
    {
       SendClientMessage(playerid, COLOR_RED, "You Are Not In A Drug Delivery Mission!");
    }
    else
    {
       new pID_name[MAX_PLAYER_NAME],Message[128];
       DestroyDynamicCP(DrugCP);
       SendClientMessage(playerid, 0xF79000FF, "You Have Now Took The Drugs,You Will Need To Go To The Car Icon On The Radar And You Will See The Checkpoint Go To It To Deliver The Drugs And Win 10K Money And 10 Scores.");
       SendClientMessage(playerid, COLOR_RED, "Warning: Players Will Come And Kill You Fast For 10K And 10 Scores Because You Are Delivering The Drugs.");
       RemovePlayerMapIcon( playerid, 0 );
       SetPlayerMapIcon(playerid, 1, 2351.8901,-1169.9969,28.0422, 55, 0, MAPICON_GLOBAL );
       DrugCPFinish = CreateDynamicCP(2351.8901,-1169.9969,28.0422, 2, -1, -1, -1, 100);
       GetPlayerName(playerid, pID_name, MAX_PLAYER_NAME);
       format(Message, sizeof(Message), "%s (%i) Has The Drugs! Kill Him To Get 10K Money And 10 Scores!",pID_name,playerid), SendClientMessageToAll(0xEFF700FF, Message);
       DrugsTaken[playerid] = 1;
       DrugsGetting[playerid] = 0;
    }
    return 1;
}

if(checkpointid == DrugCPFinish)
{
    if(DrugDeliveryStart[playerid] == 0)
    {
       SendClientMessage(playerid, COLOR_RED, "You Are Not In A Drug Delivery Mission!");
    }
    else
    {
       new pID_name[MAX_PLAYER_NAME],Message[128];
       DestroyDynamicCP(DrugCPFinish);
       SendClientMessage(playerid, 0xF79000FF, "Congratulations! You Have Delivered The Drugs! You Have Got 10K Money And 10 Scores!");
       SendClientMessage(playerid, 0xF79000FF, "Come Back If You Want More Money.");
       RemovePlayerMapIcon( playerid, 1 );
       GetPlayerName(playerid, pID_name, MAX_PLAYER_NAME);
       format(Message, sizeof(Message), "%s (%i) Has Delivered The Drugs! If You Killed Him You Won't Get The 10K Money And 10 Scores.",pID_name,playerid), SendClientMessageToAll(0xEFF700FF, Message);
       GameTextForPlayer(playerid, "Mission Completed", 5000, 5);
       DrugsTaken[playerid] = 0;
       DrugDeliveryStart[playerid] = 0;
    }
    return 1;
}



Re: Problem With This... - itsCody - 14.02.2014

Sending what message? I can't seem to understand what you're saying??


Re: Problem With This... - Youssef214 - 14.02.2014

when i enter the Checkpoint Drug CP Finish it sends me the messages that is under the Drug CP


Re: Problem With This... - itsCody - 14.02.2014

You were using 'else if' so try what Hostskool posted above


Re: Problem With This... - Youssef214 - 14.02.2014

again,it gives me alot of messages of the DrugCP when i stand on the DrugCPFinish