teleporter -
Madsen - 08.04.2011
is it possible to make a teleporter for vehicles. so if a player is inside a vehicle and he drives into these cordinates:"79.8441, -1531.5741, 2413.0000" then he will be teleported to these cordinates:"383.7876, -1602.9878, 2553.0000"
and another fast question.
anyone know how to add a death window the one in the right side where you can see how people died and who killed them.
thx for your help
Re: teleporter -
radhakr - 08.04.2011
For the teleporter, you could create a checkpoint (
https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint) and when they enter it (
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint), you can teleport them (
https://sampwiki.blast.hk/wiki/SetVehiclePos).
For the death messages:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
return 1;
}
Taken from
https://sampwiki.blast.hk/wiki/OnPlayerDeath.
Re: teleporter -
Rivera - 08.04.2011
well I can help you with the first one of. You must have zcmd and sscanf. Here, it's the cmd:
pawn Код:
CMD:tp(playerid, params[]) {
new id;
if(sscanf(params, "u", id)) {
if(IsPlayerAdmin(playerid)) {
if(!IsPlayerInAnyVehicle(playerid)) {
if(id != INVALID_PLAYER_ID) {
if(IsPlayerInRangeOfPoint(id, 10.0, 79.8441, -1531.5741, 2413.0000)) {
SetPlayerPos(id, 383.7876, -1602.9878, 2553.0000);
}
else return SendClientMessage(playerid, COLOR_PURPLE, "Player is not close to the point");
}
else return SendClientMessage(playerid, COLOR_GREY, "Error: Player not found");
}
else return SendClientMessage(playerid, COLOR_TAN, "You must be inside a vehicle to execute this command");
}
else return SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not an admin");
}
else return SendClientMessage(playerid, COLOR_ORANGE, "Syntax Error: /tp [playerid]");
return 1;
}
Re: teleporter -
xir - 08.04.2011
Here
pawn Код:
COMMAND:teleporter(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 10.0, 79.8441, -1531.5741, 2413.0000)) return SendClientMessage(playerid, -1, "You need to be at that location");
if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,-1,"You need to be in a vehicle to use this command");
else
{
new vehicle = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicle, 383.7876, -1602.9878, 2553.0000);
SetPlayerPos(playerid,383.7876, -1602.9878, 2553.0000);
PutPlayerInVehicle(playerid,vehicle,0);
}
return 1;
}
Re: teleporter -
Madsen - 08.04.2011
i already made this as a checkpoint but i hate having the little red dot on the minimap. so i was wondering if there was another way to do it that made people teleport automatically. i dont want any commands just a teleporter. like OnPlayerPickUpPickUp then i can make a pickup and when a player runs into it he can get teleported.
i use normal pawn scripting since i dont want to change everything to zcmd.
Re: teleporter -
Rivera - 08.04.2011
well... I never worked on these kind of tp's before. You can try this:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(IsPlayerInAnyVehicle(playerid)) {
if(IsPlayerInRangeOfPoint(playerid, 10.0, 79.8441, -1531.5741, 2413.0000)) {
new vid = GetPlayerVehicleID(playerid);
SetVehiclePos(vid, 383.7876, -1602.9878, 2553.0000);
SetPlayerPos(playerid, 383.7876, -1602.9878, 2553.0000);
PutPlayerInVehicle(playerid, vid, 1);
}
}
return 1;
}
Re: teleporter -
xir - 08.04.2011
Hm, try it with this callback
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
Quote:
Originally Posted by Madsen
i use normal pawn scripting since i dont want to change everything to zcmd.
|
My advice, I am sure also many other people would advice you this.
Start changing. It will be hard to work with strtok. Though with sscanf it is alot easier once you get started.
Try reading some tutorials about it, and when you cant figure out to make the CMD, you can ask help here on SA-MP forum. Believe me, zcmd & sscanf won't let you down.
Re: teleporter -
Madsen - 09.04.2011
i know how to use zcmd, it's just that i dont want to change all my commands
Re: teleporter -
Madsen - 09.04.2011
i do not think it is possible to do this without the checkpoint