[Ajuda]Teleporte
#1

Oie Gente tipow to com um poblema que й assim eu to terminando um gm de drift aki ai eu to fazendo os teleportes e quando eu faзo um vai di boa so que quando digita o teleporte in game tudo que vc digita com / ele vai pra um mesmo teleporte.


codigo:
Код:
 public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/admins", true) == 0)
	{
    new Jogador[24];
    new count5;
    new msg[120];
    for(new i=0; i<MAX_PLAYERS; i++){
    if(IsPlayerConnected(i) && IsPlayerAdmin(i)){
    GetPlayerName(i,Jogador,24);
    format(msg,sizeof(msg),"Admins Online: %s", Jogador);
    SendClientMessage(playerid, 0xFFFFFFAA, msg);
    count5++;
    }
    }
    if(count5 == 0){
   SendClientMessage(playerid, 0xFFFFFFAA, "Nenhum Admin Online No Momento Aguarde.");
   }
   return 1;
   //Prox
if (strcmp("/Advance2", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, -2423.2783,-609.5183,132.5589);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, -2423.2783,-609.5183,132.5589);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance3", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, 1257.6019,-2027.8704,59.4885);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, 1257.6019,-2027.8704,59.4885);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance4", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, 2295.4639,1389.8578,42.8203);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, 2295.4639,1389.8578,42.8203);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance5", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, 2259.6487,1963.1309,31.7797);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, 2259.6487,1963.1309,31.7797);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance6", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, 2892.3997,2431.1709,10.8203);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, 2892.3997,2431.1709,10.8203);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance7", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, 2717.1382,-1508.3368,30.2729);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, 2717.1382,-1508.3368,30.2729);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance8", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, 2806.3691,-1438.4415,40.0432);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, 2806.3691,-1438.4415,40.0432);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance9", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, 2499.1069,1272.4935,10.8125);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, 2499.1069,1272.4935,10.8125);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance10", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, -57.5438,-1414.3257,11.7628);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, -57.5438,-1414.3257,11.7628);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance11", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, -879.6669,1962.4957,60.1157,0.0000);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, -879.6669,1962.4957,60.1157,0.0000);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance12", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, -738.0212,2632.8623,65.9041,0.0000);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, -738.0212,2632.8623,65.9041,0.0000);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance13", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, 2297.8271,1579.0549,23.3896,0.0000);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, 2297.8271,1579.0549,23.3896,0.0000);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance14", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, -1994.4552,343.3547,35.0156,0.0000);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, -1994.4552,343.3547,35.0156,0.0000);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance15", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, -57.5438,-1414.3257,11.7628,0.0000);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, -57.5438,-1414.3257,11.7628,0.0000);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance16", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, -1896.6702,-141.8418,38.2422,0.0000);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, -1896.6702,-141.8418,38.2422,0.0000);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance17", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, 2224.3079,2770.3950,10.8140,0.0000);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, 2224.3079,2770.3950,10.8140,0.0000);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance18", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, 2041.7959,1889.8982,11.9545,0.0000);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, 2041.7959,1889.8982,11.9545,0.0000);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance19", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, -760.3386,-1675.9905,97.2323,0.0000);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, -760.3386,-1675.9905,97.2323,0.0000);
SetPlayerFacingAngle(playerid,0.0);
}
//Prox
if (strcmp("/Advance20", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, -2083.0410,-757.3891,66.8750,357.6912);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
SetPlayerInterior(playerid,0);}
}
else{
SetPlayerInterior(playerid,0);{}
SetPlayerPos(playerid, -2083.0410,-757.3891,66.8750,357.6912);
SetPlayerFacingAngle(playerid,0.0);
Reply
#2

Falta returns, e identa melhor seu cуdigo.
Reply
#3

Manoo, jб tento fazer teleporte em dialog? Por que pelo visto ai, tem um teleporte de carro e outra pelo personagem que se teleporta pelo comando, fazendo isso sem dialog, ocasiona esse conflito pelo teleporte com o mesmo comando, eu tambйm tenho server de drift, como vocк pode ver pela sign, eu faзo os teleporte tudo pelo dialog, e me ajuda muito, se vocк quiser mesmo que so teleporte o cara, use:

pawn Код:
if (strcmp("/Advance2", cmdtext, true, 10) == 0){
SetPlayerPos(playerid, -2423.2783,-609.5183,132.5589);{
return 1;}
Mais se quiser que teleporta o cara e o carro junto, teria que fazer com dialog
Reply
#4

Quote:
Originally Posted by ViCtOr_Mc
Посмотреть сообщение
Manoo, jб tento fazer teleporte em dialog? Por que pelo visto ai, tem um teleporte de carro e outra pelo personagem que se teleporta pelo comando, eu tambйm tenho server de Drift, como vocк pode ver pela sign, eu faзo os teleporte tudo pelo dialog, e me ajuda muito, se vocк quiser mesmo que so teleporte o cara, use:

pawn Код:
if (strcmp("/Advance2", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, -2423.2783,-609.5183,132.5589);
return 1;
}
Teleport do seu servidor й tenso, tem umas 15 arenas de drift e nгo mostra pra onde o cara foi, sу avisa que ele foi pro drift mas nгo fala qual.

Identa esse seu cуdigo lol.
Reply
#5

Josma Tipow Sou Mt Novato Nisso Se Vocк Me Ensinase Ficaria Muito Melhor
Reply
#6

Cara chave que vocк abre vocк precisa fechar, vocк nгo pode deixar seus cуdigos assim todo mau organizado, e faltou return, sem o return todos os cуdigos vгo se tornar o mesmo cуdigo.

Exemplo:
pawn Код:
if(strcmp(cmdtext, "/comando", true) == 0)
{
    //sintaxes, teleport etc
    return 1;
}
Vocк tem que seguir essa linha, o seu processador de comandos no caso strcmp, abre a chave, coloca as sintaxes, retorna e fecha a chave.

A programaзгo й sempre separado em 3 partes, entrada, processamento e saнda de cуdigos.
E sobre a identaзгo, se vocк nгo identar irб dar warning de loose identation, vocк tem que seguir sempre 4 espaзos apуs a chave.
Reply
#7

Ou Josma, o que eu nгo intendo, e que depois de um tempo, quando comeзar a lotar gente, os comandos para de funcionar, й algum bug do meu GM?
Reply
#8

Hm Agora eu Entedi Vlw
Reply
#9

Quote:
Originally Posted by ViCtOr_Mc
Посмотреть сообщение
Ou Josma, o que eu nгo intendo, e que depois de um tempo, quando comeзar a lotar gente, os comandos para de funcionar, й algum bug do meu GM?
Tenho quase certeza que aquele seu contador de players online estб bugando o servidor inteiro.

Quote:
Originally Posted by [GangsTa]Bia
Посмотреть сообщение
tambйm estudou pseudocуdigo & lуgica de programaзгo =)
isto, que poucos pensaram estudar aq ...
De um tempo pra cб decidi acumular o mбximo de conhecimento possнvel relacionado a programaзгo, acabei lendo algumas apostilas =)
Reply
#10

nгo sei se ajuda.. + vamos la.....
pawn Код:
no topo...
new Cppp[ MAX_PLAYER_NAME ], Cstring[ 140 ];
pawn Код:
if(strcmp(cmdtext, "/estacionamento", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos( GetPlayerVehicleID( playerid ), -30.963,1509.681,12.556 );
SetVehicleZAngle( GetPlayerVehicleID( playerid ), 357.7119 );
LinkVehicleToInterior( GetPlayerVehicleID(playerid), 0 );
SetPlayerInterior(playerid,0);
GetPlayerName( playerid, Cppp, MAX_PLAYER_NAME );
format( Cstring, sizeof Cstring , "%s {FFFFFF}Foi Para o Estacionamento [ {FFFF00}/estacionamento {FFFFFF}]", Cppp );
SendClientMessageToAll( 0xFFFF00AA, Cstring );
}
else
{
SetPlayerPos(playerid, -30.963,1509.681,12.556);
SetPlayerFacingAngle(playerid, 357.7119);
SetPlayerInterior(playerid,0);
GetPlayerName( playerid, Cppp, MAX_PLAYER_NAME );
format( Cstring, sizeof Cstring , "%s {FFFFFF}Foi Para o Estacionamento [ {FFFF00}/estacionamento {FFFFFF}]", Cppp );
SendClientMessageToAll( 0xFFFF00AA, Cstring );
}
return true;
}
agora tu vai copiando e fazendo + teles.. mudando coordenadas... e as falas.. pra onde foi.... espero ter ajudado..


se ajudei clica na estrela ali <
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)