06.01.2011, 11:37
if you repeat the code:
or switch positions:
Still not working?
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;
}
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;
}