Killing a Checkpoint
#1

So, I tried this:

Код:
CMD:killcheckpoint(playerid, params[])
{
DisablePlayerCheckpoint(playerid);
return 1;
}
to kill a checkpoint, but that doesn't work. I wan't it to kill those checkpoints that are about a 2x2 red square on the map. NOT the san andreas checkpoints you make on the map with right click

If anyone could do this, I would appreciate it.
Reply
#2

Why are you using params[] when there are no params?
pawn Код:
CMD:killcheckpoint(playerid)
{
    DisablePlayerCheckpoint(playerid);
    return 1;
}
Reply
#3

Quote:
Originally Posted by reckst4r
Посмотреть сообщение
Why are you using params[] when there are no params?
pawn Код:
CMD:killcheckpoint(playerid)
{
    DisablePlayerCheckpoint(playerid);
    return 1;
}
When I do /killcheckpoint, it goes away for a second then comes back.

I am a C++ noob.
Reply
#4

@OP: You're talking about map-icons, then. Try this: RemovePlayerMapIcon

@reckst4r: It doesn't matter if you don't use it. However, you can always add this, if you don't: #pragma unused params
Reply
#5

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
@OP: You're talking about map-icons, then. Try this: RemovePlayerMapIcon

@reckst4r: It doesn't matter if you don't use it. However, you can always add this, if you don't: #pragma unused params
I am talking about these:



I want /killcheckpoint to get rid of it.
Reply
#6

Right. If DisablePlayerCheckpoint isn't working, try the function I gave you. It is ALSO capable of adding these little blimps on the map.
Reply
#7

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Right. If DisablePlayerCheckpoint isn't working, try the function I gave you. It is ALSO capable of adding these little blimps on the map.
Didn't work, I am doing /callcar with the Advanced Vehicle System filterscript, maybe that is why.

I used

Код:
CMD:killcheckpoint(playerid)
{
    RemovePlayerMapIcon( playerid, 0 );
    SendClientMessage(playerid, COLOR_YELLOW, "You have terminated your checkpoint");
    return 1;
}
Reply
#8

Show the function that is making that blimp.
Reply
#9

Quote:
Originally Posted by reckst4r
Посмотреть сообщение
Why are you using params[] when there are no params?
pawn Код:
CMD:killcheckpoint(playerid)
{
    DisablePlayerCheckpoint(playerid);
    return 1;
}
Completely irrelevant to the topic.. I wouldn't care if you at least said something like "YO THIS IS THE PROBLEM" even if it was wrong. Adding params[] wouldn't make much of a difference in the actual performance (not speed) of the command.


Quote:
Originally Posted by xXRealLegitXx
Посмотреть сообщение
When I do /killcheckpoint, it goes away for a second then comes back.

I am a C++ noob.
Check when it's created if it sets a timer that creates the checkpoint again. If it goes away, then it's probably being disabled but then set again.
Reply
#10

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
Completely irrelevant to the topic.. I wouldn't care if you at least said something like "YO THIS IS THE PROBLEM" even if it was wrong. Adding params[] wouldn't make much of a difference in the actual performance (not speed) of the command.




Check when it's created if it sets a timer that creates the checkpoint again. If it goes away, then it's probably being disabled but then set again.
I was looking in the AVS filter script and this is the command for /callcar (which created the checkpoint)

Код:
CMD:callcar(playerid, params[])
{
	if(TrackCar[playerid])
	{
		TrackCar[playerid] = 0;
		DisablePlayerCheckpoint(playerid);
		SendClientMessage(playerid, COLOR_WHITE, "You are not tracking your vehicle anymore");
		return 1;
	}
	new playername[24];
	GetPlayerName(playerid, playername, sizeof(playername));
	new info[256], bool:found;
	for(new i=1; i < MAX_DVEHICLES; i++)
	{
		if(VehicleCreated[i] == VEHICLE_PLAYER && strcmp(VehicleOwner[i], playername) == 0)
		{
			found = true;
			format(info, sizeof(info), "%sID: %d  Name: %s\n", info, i, VehicleNames[VehicleModel[i]-400]);
		}
	}
	if(!found) return SendClientMessage(playerid, COLOR_RED, "You don't have any vehicles!");
	ShowPlayerDialog(playerid, DIALOG_FINDVEHICLE, DIALOG_STYLE_LIST, "Find Your Vehicle", info, "Find", "Cancel");
	return 1;
}
I know it has its own kill checkpoint system, but I want this command to be created to kill every checkpoint, as in the future more commands will add checkpoints.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)