[HELP] My Gamemode has a problem with Public functions
#3

if you repeat the code:

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == OttoDestroy)
    {
        if(BuyingInProgress == 1) { return SendClientMessage(playerid,rot,"[OTTO]: Please wait a moment. There is another customer now!"); }
        else if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid,rot,"[OTTO]: Park the car outside and come back!"); }
        else if(PlayerInfo[playerid][cid] == 0) { return SendClientMessage(playerid,rot,"[OTTO]: You don't have a Car to sell it here!"); }
        else
        {
            SetTimer("ResetBuyingInProgress",6000,0);
            BuyingInProgress = 1;
            //EVERYTHING UNTIL HERE WILL BE EXECUTED AND WORKS
               
            //BUT FROM NOW THESE LINES WILL BE IGNORED SOMEHOW AND THEY DONT WORK:
            DestroyCar(GetPlayerVehicleID(playerid));
            GivePlayerMoney(playerid,10000);
            DestroyCar(GetPlayerVehicleID(playerid));
            GivePlayerMoney(playerid,10000);
        }
    }
    return 1;
}
or switch positions:

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == OttoDestroy)
    {
        if(BuyingInProgress == 1) { return SendClientMessage(playerid,rot,"[OTTO]: Please wait a moment. There is another customer now!"); }
        else if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid,rot,"[OTTO]: Park the car outside and come back!"); }
        else if(PlayerInfo[playerid][cid] == 0) { return SendClientMessage(playerid,rot,"[OTTO]: You don't have a Car to sell it here!"); }
        else
        {
            DestroyCar(GetPlayerVehicleID(playerid));
            GivePlayerMoney(playerid,10000);
            //EVERYTHING UNTIL HERE WILL BE EXECUTED AND WORKS
               
            //BUT FROM NOW THESE LINES WILL BE IGNORED SOMEHOW AND THEY DONT WORK:
            SetTimer("ResetBuyingInProgress",6000,0);
            BuyingInProgress = 1;
        }
    }
    return 1;
}
Still not working?
Reply


Messages In This Thread
[HELP] My Gamemode has a problem with Public functions - by DJ-CJ89 - 06.01.2011, 09:33
AW: [HELP] My Gamemode has a problem with Public functions - by DJ-CJ89 - 06.01.2011, 10:55
Re: [HELP] My Gamemode has a problem with Public functions - by KingstoN* - 06.01.2011, 11:37
AW: [HELP] My Gamemode has a problem with Public functions - by DJ-CJ89 - 06.01.2011, 17:43
AW: [HELP] My Gamemode has a problem with Public functions - by DJ-CJ89 - 06.01.2011, 19:50

Forum Jump:


Users browsing this thread: 1 Guest(s)