24.02.2015, 20:15
Hey guys, this is my first Tutorial.
Today i will show you my ideea.
SetCheckPointEx.If the player already have a active checkpoint, he need to confirm the change of checkpoint.
I will show You
First, create a global "new" ,under #include <a_samp> etc...
Under
we create this:
Under OnPlayerConnect put this:
And the OnPlayerDialogResponse...
I repet, this is my first tutorial, i hope you like, SORRY FOR BAD ENGLISH
P.S: i don't tested it, but can't have bugs
Today i will show you my ideea.
SetCheckPointEx.If the player already have a active checkpoint, he need to confirm the change of checkpoint.
I will show You
First, create a global "new" ,under #include <a_samp> etc...
Code:
new bool:HaveACheckPoint[MAX_PLAYERS];
Code:
new bool:HaveACheckPoint[MAX_PLAYERS];
Code:
stock SetCheckPointEx(playerid,float:X,Float:Y,Float:Z,Float:size) // create a new stock { if(HaveACheckPoint[playerid] == false) // check if the player have a checkpoint { SetPlayerCheckpoint(playerid, X, Y, Z,size); // Set The checkpoint HaveACheckPoint[playerid] = true; //Now player have a checkpoint }else{ ShowPlayerDialog(playerid, 4942, DIALOG_STYLE_MSGBOX, "Notice", "Are you sure? You wana delete current CheckPoint?", "Yes", "No"); //Put the question }
Code:
HaveACheckPoint[playerid] = false; // this player is connected now, can't have a checkpoint
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 4942) { if(response) // If they clicked 'Yes' or pressed enter { DisablePlayerCheckpoint(playerid); } return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText. } return 0; // You MUST return 0 here! Just like OnPlayerCommandText. }
P.S: i don't tested it, but can't have bugs