SA-MP Forums Archive
[Pedido] Como crio teleporte? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Como crio teleporte? (/showthread.php?tid=562073)



Como crio teleporte? - TheM4st3r - 06.02.2015

ta assim

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something hereGivePlayerMoney()
return 1;
}
return 0;
}

como eu fasso varios teles sem erro?


Re: Como crio teleporte? - NexNix - 06.02.2015

O cara criou um tуpico agora pouco se quiser da uma olhada clicando aqui.

Mas de uma forma simples:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
if (
strcmp("/teleporte"cmdtexttrue10) == 0)
{
SetPlayerPos(playerid,x,y,z); // Cordenadas para aonde o player vai ser teleportado.
return 1;
}
return 
1;

E tambйm te aconselho a usar zcmd e sscanf.


Re: Como crio teleporte? - TheM4st3r - 06.02.2015

eu to usando essas includes sim

mais tipo como envio frases para todos os players falando

fulano foi para(teleporte)quer ir use /(comando)?


Re: Como crio teleporte? - AlucardSnow - 06.02.2015

Quote:
Originally Posted by TheM4st3r
Посмотреть сообщение
eu to usando essas includes sim

mais tipo como envio frases para todos os players falando

fulano foi para(teleporte)quer ir use /(comando)?
SendClientMessageToAll


Re: Como crio teleporte? - SkyneTSAMP - 07.02.2015

Eu Uso Esse:

PHP код:
if(strcmp(cmdtext"/DP"true) == 0) {
   if(
IsPlayerInAnyVehicle(playerid)) {
   new 
VehicleID;
   
VehicleID GetPlayerVehicleID(playerid);
   
SetVehiclePos(VehicleID,1543.7841,-1675.3546,13.5571);
   
SetVehicleZAngle(GetPlayerVehicleID(playerid), 1.1080);
   new 
pname[MAX_PLAYER_NAME];
   
GetPlayerName(playeridpnameMAX_PLAYER_NAME);
   
format(stringsizeof(string), "%s Foi Para DP De Los Santos: {FFFF00}/DP"pname);
   
SendClientMessageToAll(0x00FF00FFstring);
   
SetPlayerInterior(playerid,0);
   
PlayerPlaySound(playerid11330.00.00.0);
 }
   else{
       new 
pname[MAX_PLAYER_NAME];
       
GetPlayerName(playeridpnameMAX_PLAYER_NAME);
       
format(stringsizeof(string), "%s Foi Para DP De Los Santos: {FFFF00}/DP"pname);
       
SendClientMessageToAll(0x00FFFFFFstring);
       
SetPlayerInterior(playerid,0);
       
SetPlayerPos(playerid,1543.7841,-1675.3546,13.5571);
       
SetPlayerFacingAngle(playerid,190.9207);
       
PlayerPlaySound(playerid11330.00.00.0);
}
    return 
1;