Checkpoint issue.
#1

Hello SA-MP Community!

I got a issue with checkpoint, what im trying to make is a checkpoint where pops up a dialooges etc to repair vehicle and so on, and somehow when i enter go to checkpoint with vehicle (inside that checkpoint) it wont pop up a dialog for me, but when i walk in it will

Code:
Код:
if(checkpointid == GM[fuelstationCP] && !found)
		{
		if(!IsPlayerInAnyVehicle(playerid))
	        {       
			Player[playerid][enteredCP] = GetTickCount();
		    ShowPlayerDialog(playerid, DIALOG_FUELSTATION, DIALOG_STYLE_LIST, "Fuel station", "Repair vehicle"CHAT_YELLOW"", "Buy", "Cancel");
		    found = true;
			}
			else
			{
				Server(playerid, "You must be inside vehicle to use this checkpoint");
			}
		}
Where can be the problem?
Reply
#2

PHP код:
if(checkpointid == GM[fuelstationCP] && !found)
        {
        if(
IsPlayerInAnyVehicle(playerid))//Here was the problem
            
{       
            
Player[playerid][enteredCP] = GetTickCount();
            
ShowPlayerDialog(playeridDIALOG_FUELSTATIONDIALOG_STYLE_LIST"Fuel station""Repair vehicle"CHAT_YELLOW"""Buy""Cancel");
            
found true;
            }
            else
            {
                
Server(playerid"You must be inside vehicle to use this checkpoint");
            }
        } 
PHP код:
if(!IsPlayerInAnyVehicle(playerid)) //Means if player is not in any vehicle 
Reply
#3

Oh, what it supposed to be then?

What i found at SA-MP
Check if a player is inside any vehicle (as a driver or passenger). - IsPlayerInAnyVehicle
Reply
#4

PHP код:
if(!IsPlayerInAnyVehicle(playerid)) 
This ^^ means the player is not in a vehicle (! means not or returning false value)
you should make it like this
PHP код:
if(IsPlayerInAnyVehicle(playerid)) 
Reply
#5

Still it wont pop up a dialog, now aswell when i try to walk inside it, it pops up a message
Код:
Server(playerid, "You must be inside vehicle to use this checkpoint");
Reply
#6

Quote:
Originally Posted by Frank901
Посмотреть сообщение
Still it wont pop up a dialog, now aswell when i try to walk inside it, it pops up a message
Код:
Server(playerid, "You must be inside vehicle to use this checkpoint");
show me what you edited in the script
Reply
#7

Код:
case DIALOG_FUELSTATION:
		{
			if(response)
			{
				switch(listitem)
				{
					case 0:
					{
                    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
                    RepairVehicle(GetPlayerVehicleID(playerid));
                    Server(playerid, "Your vehicle has been repaired!");
                    return 1;
                    }
				}
			}
		}
Thats the dialog i made, it should be fine i guess?
Reply
#8

Quote:
Originally Posted by Frank901
Посмотреть сообщение
Код:
case DIALOG_FUELSTATION:
		{
			if(response)
			{
				switch(listitem)
				{
					case 0:
					{
                    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
                    RepairVehicle(GetPlayerVehicleID(playerid));
                    Server(playerid, "Your vehicle has been repaired!");
                    return 1;
                    }
				}
			}
		}
Thats the dialog i made, it should be fine i guess?
I did tell you to edit the part of dialog calling not dialog definition (the part you posted above has to be like below)
Код:
if(checkpointid == GM[fuelstationCP] && !found)
		{
		if(IsPlayerInAnyVehicle(playerid))
	        {       
			Player[playerid][enteredCP] = GetTickCount();
		    ShowPlayerDialog(playerid, DIALOG_FUELSTATION, DIALOG_STYLE_LIST, "Fuel station", "Repair vehicle"CHAT_YELLOW"", "Buy", "Cancel");
		    found = true;
			}
			else
			{
				Server(playerid, "You must be inside vehicle to use this checkpoint");
			}
		}
Reply
#9

I'm using INC files, store.inc and dialog.inc "DIALOG_FUELSTATION" is in dialog.inc, this is the place where i script in dialooges, aswell store ill just add dialooges right?
What i need is that it would pop up a dialog if i enter to checkpoint while im in vehicle.

I got this, and still it wont pop up a dialog.
PHP код:
if(checkpointid == GM[fuelstationCP] && !found)
        {
        if(
IsPlayerInAnyVehicle(playerid))  
            {       
            
Player[playerid][enteredCP] = GetTickCount();
            
ShowPlayerDialog(playeridDIALOG_FUELSTATIONDIALOG_STYLE_LIST"Fuel station""Repair vehicle"CHAT_YELLOW"""Go""Cancel");
            
found true;
            }
            else
            {
                
Server(playerid"You must be inside vehicle to use this checkpoint");
            }
        } 
Reply
#10

Anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)