Need Urgent Help Please Help
#1

I Have A Job FilterScript That Set A Checkpoint And Player Gets Money On Entering It , But A player Tried Setting Anohter Checkpoint Near Job And Earned Money There ... I Want To Make It Like The Player Cant Set Another Checkpoint Until He Disables The First (Or If He Exits The Vehicle He's Working In) ... So Please Fix My Command Below Please Please Please Or Just Tell Me How To Do THis ... I Have Tried Everything I CAnt Work This One Out ..

COMMAND:gunshop(playerid, cmdtext)
{
If(GetPlayerCheckpoint(playerid)
SetPlayerCheckpoint(playerid, -2134.4019,-43.0432,35.3203,5.0);
DestroyVehicle(413);
}
return 1;
}
Reply
#2

Код:
COMMAND:gunshop(playerid, cmdtext)
{
	new placedcheckpoint, string[128], xpos, ypos, zpos, veh;
	if(placedcheckpoint == 1) // checks if the player has made a checkpoint.
	{
		GetPlayerPos(playerid, xpos, ypos, zpos);// gets their current pos
		veh = GetPlayerVehicleID(playerid); // gets the vehicle they are driving.
		SetPlayerCheckpoint(playerid, xpos,ypoz,zpos); // Sets the checkpoint as their current pos
 		DestroyVehicle(veh); // destroys the vehicle they are driving.
	}
	else
	{
		//something that it will do if the checkpoint hasnt been placed, as an example:
		placedcheckpoint = 1; // setting the "placedcheckpoint" mark as 1 allowing the above to happen
	}
	return 1;
}
Let me know if any problems occur
Reply
#3

Destroy Vehicle ? , I Use This But I Dont Want To Use It , I Just Want It To Check The Checkpoint And If He Already Have An Active Checkpoint then return SendCl..Message(...,....,You Already Have An Active CheckPoint) , So He Can't Make Another Check Until He Disables The Active One , I Hope You Understand ...
Reply
#4

pawn Код:
new CheckPoint[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    CheckPoint[playerid] = 0;
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    CheckPoint[playerid] = 0;
    return 1;
}

COMMAND:gunshop(playerid, cmdtext)
{
    new string[128], xpos, ypos, zpos, veh;
    if(CheckPoint[playerid] == 1) return SendClientMessage(playerid, -1, "You already have an active checkpoint!");
    GetPlayerPos(playerid, xpos, ypos, zpos);// gets their current pos
    veh = GetPlayerVehicleID(playerid); // gets the vehicle they are driving.
    SetPlayerCheckpoint(playerid, xpos,ypoz,zpos); // Sets the checkpoint as their current pos
    DestroyVehicle(veh); // destroys the vehicle they are driving.
    CheckPoint[playerid] = 1;
    return 1;
}
Reply
#5

I'll Try And If It Works , I Will Rep+ You ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)