SA-MP Forums Archive
[Ajuda] BUG - 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: [Ajuda] BUG (/showthread.php?tid=587911)



BUG - maxblaya01 - 03.09.2015

fiz um comando para pegar moto mais tipo, da pra pegar varias vezes tem como por pra poder criar so uma?

codigo:

Quote:
Код:
  if(strcmp(cmdtext,"/m",true)==0) {
	GetPlayerPos(playerid, Xx,Yy,Zz);
	GetPlayerFacingAngle(playerid,Anglee);
	gINT = GetPlayerInterior(playerid);
	carro[playerid]=CreateVehicle(522, Xx+6,Yy,Zz+1, Anglee, random(127), random(127), -1);
	LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);
    return 1;
  }



Re: BUG - BartWhite - 03.09.2015

Tenta ai:

Код:
new bool:CrieiMoto[MAX_PLAYERS]; //no topo

public OnPlayerConnect(playerid)
{
     CrieiMoto[playerid] =0;
     return 1;
}

 if(strcmp(cmdtext,"/m",true)==0) {
	if(CrieiMoto = 1) return SenClientMessage(playerid, 0xFF0000FF, "Vocк jб criou uma moto!");
        GetPlayerPos(playerid, Xx,Yy,Zz);
	GetPlayerFacingAngle(playerid,Anglee);
	gINT = GetPlayerInterior(playerid);
	carro[playerid]=CreateVehicle(522, Xx+6,Yy,Zz+1, Anglee, random(127), random(127), -1);
	LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);
    return 1;
  }
Nгo testei, se der algum erro me avisa.


Re: BUG - SepZ - 03.09.2015

tenta assim

PHP код:
if(strcmp(cmdtext,"/m",true)==0)
{
    if(
IsValidVehicle(carro[playerid])) DestroyVehicle(carro[playerid]);
    
    
GetPlayerPos(playeridXx,Yy,Zz);
    
GetPlayerFacingAngle(playerid,Anglee);
    
gINT GetPlayerInterior(playerid);
    
carro[playerid]=CreateVehicle(522Xx+6,Yy,Zz+1Angleerandom(127), random(127), -1);
    
LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);
    
    return 
1;




Re: BUG - BartWhite - 03.09.2015

Se vocк nгo quiser que o player crie mais de uma moto use o meu code, se quiser que destrua a ultima moto criada e crie uma nova use o code SepZ


Re: BUG - SepZ - 03.09.2015

Quote:
Originally Posted by BartWhite
Посмотреть сообщение
Se vocк nгo quiser que o player crie mais de uma moto use o meu code, se quiser que destrua a ultima moto criada e crie uma nova use o code SepZ
Pra nгo conseguir criar outro
PHP код:
if(IsValidVehicle(carro[playerid])) return SendClientMessage(playerid0xFF0000FF"* Vocк ja criou um veiculo"); 



Re: BUG - maxblaya01 - 03.09.2015

Quote:
Originally Posted by SepZ
Посмотреть сообщение
tenta assim

PHP код:
if(strcmp(cmdtext,"/m",true)==0)
{
    if(
IsValidVehicle(carro[playerid])) DestroyVehicle(carro[playerid]);
    
    
GetPlayerPos(playeridXx,Yy,Zz);
    
GetPlayerFacingAngle(playerid,Anglee);
    
gINT GetPlayerInterior(playerid);
    
carro[playerid]=CreateVehicle(522Xx+6,Yy,Zz+1Angleerandom(127), random(127), -1);
    
LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);
    
    return 
1;

C:\Documents and Settings\MaxiMuS\Desktop\New Server\gamemodes\new.pwn(1405) : error 017: undefined symbol "IsValidVehicle"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

deu esse erro aqui ?


AW: BUG - cicinho - 03.09.2015

PHP код:
native IsValidVehicle(vehicleid); 
Bote antes da include "a_samp".


Re: AW: BUG - maxblaya01 - 03.09.2015

Quote:
Originally Posted by SepZ
Посмотреть сообщение
tenta assim

PHP код:
if(strcmp(cmdtext,"/m",true)==0)
{
    if(
IsValidVehicle(carro[playerid])) DestroyVehicle(carro[playerid]);
    
    
GetPlayerPos(playeridXx,Yy,Zz);
    
GetPlayerFacingAngle(playerid,Anglee);
    
gINT GetPlayerInterior(playerid);
    
carro[playerid]=CreateVehicle(522Xx+6,Yy,Zz+1Angleerandom(127), random(127), -1);
    
LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);
    
    return 
1;

Quote:
Originally Posted by cicinho
Посмотреть сообщение
PHP код:
native IsValidVehicle(vehicleid); 
Bote antes da include "a_samp".
ae coloquei antes agora deu 4 erros:

C:\Documents and Settings\MaxiMuS\Desktop\New Server\gamemodes\new.pwn(1444) : error 017: undefined symbol "carro"
C:\Documents and Settings\MaxiMuS\Desktop\New Server\gamemodes\new.pwn(1444) : warning 215: expression has no effect
C:\Documents and Settings\MaxiMuS\Desktop\New Server\gamemodes\new.pwn(1444) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\MaxiMuS\Desktop\New Server\gamemodes\new.pwn(1444) : error 029: invalid expression, assumed zero
C:\Documents and Settings\MaxiMuS\Desktop\New Server\gamemodes\new.pwn(1444) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


Linha 1444: if(IsValidVehicle(carro[playerid])) DestroyVehicle(carro[playerid]);


Re: BUG - SepZ - 03.09.2015

PHP код:
native IsValidVehicle(vehicleid);
new 
Carro[MAX_PLAYERS];
//
if(strcmp(cmdtext"/m"true) == 0)
{
    if(
IsValidVehicle(Carro[playerid])) DestroyVehicle(Carro[playerid]);
    new 
Float:xFloat:yFloat:zFloat:agINT;
    
GetPlayerPos(playeridx,y,z);
    
GetPlayerFacingAngle(playerid,a);
    
gINT GetPlayerInterior(playerid);
    
Carro[playerid] = CreateVehicle(522x+6,y,z+1arandom(127), random(127), -1);
    
LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);




Re: BUG - maxblaya01 - 03.09.2015

Quote:
Originally Posted by SepZ
Посмотреть сообщение
PHP код:
native IsValidVehicle(vehicleid);
new 
Carro[MAX_PLAYERS];
//
if(strcmp(cmdtext"/m"true) == 0)
{
    if(
IsValidVehicle(Carro[playerid])) DestroyVehicle(Carro[playerid]);
    new 
Float:xFloat:yFloat:zFloat:agINT;
    
GetPlayerPos(playeridx,y,z);
    
GetPlayerFacingAngle(playerid,a);
    
gINT GetPlayerInterior(playerid);
    
Carro[playerid] = CreateVehicle(522x+6,y,z+1arandom(127), random(127), -1);
    
LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);

deu certo mano , mais tipo quando eu crio o veiculo ele cria ao lado da skin, nao da pra criar e ja estar dentro?