[ajuda] Erro com "PlayerPos"
#1

Tentei criar 1 sisteminha rapidinho, pra ter ideia de RC, mas deu fail, n sei pq

Vo mandar o FS completo!

Код:
#include <a_samp>
#define COLOR_GREEN 0x33AA33AA


new Float:X Float:Y, Float:Z;
new Float: playerPos;


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/controlarrc", cmdtext, true, 10) == 0) 
    {
       SendClientMessage(playerid, COLOR_GREEN, "Vocк ira controlar um carro RC");
       GetPlayerPos(playerid, X, Y, Z);
       CreateVehicle(441,X, Y, Z,0.0,-1,-1,1000);
       PutPlayerInVehicle(playerid, 441, 0);
       return 1;
    }
    return 0;
}
Linhas do erros

Код:
C:\Users\User4\Desktop\futebol.pwn(5) : error 001: expected token: ";", but found "-label-"
C:\Users\User4\Desktop\futebol.pwn(14) : error 017: undefined symbol "Y"
C:\Users\User4\Desktop\futebol.pwn(15) : error 017: undefined symbol "Y"
C:\Users\User4\Desktop\futebol.pwn(20) : warning 203: symbol is never used: "playerPos"
Quem ajudar ganha REP!
Reply
#2

pawn Код:
#include <a_samp>
#define COLOR_GREEN 0x33AA33AA


new Float:X, Float:Y, Float:Z;
//new Float: playerPos;


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/controlarrc", cmdtext, true, 10) == 0)
    {
       SendClientMessage(playerid, COLOR_GREEN, "Vocк ira controlar um carro RC");
       GetPlayerPos(playerid, X, Y, Z);
       CreateVehicle(441,X, Y, Z,0.0,-1,-1,1000);
       PutPlayerInVehicle(playerid, 441, 0);
       return 1;
    }
    return 0;
}
Reply
#3

Aff, consegui, kkk calma ae
Reply
#4

Antes de vc postar eu tinha conseguido, tinha faltado 1 virgulo no Y, pos isso n tava reconhecendo kkkkkkkkkkkkkkkkkkkkkkkkk

Vlw ae, vo dar REP mesmo assim kk
Reply
#5

AFF, MAS OLHA SOH, ta dando tudo certinho, mas eu n to conseguindo dirigir o RC veiculo, aparece ele no lugar q eu to, tudo certinho, mas eu n consigo dirigirr, aa, oq eu faзo ?
Reply
#6

faзa assim:

pawn Код:
#include <a_samp>
#define COLOR_GREEN 0x33AA33AA


new Float:X, Float:Y, Float:Z;
new CarroRC[MAX_PLAYERS];


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/controlarrc", cmdtext, true, 10) == 0)
    {
       SendClientMessage(playerid, COLOR_GREEN, "Vocк ira controlar um carro RC");
       GetPlayerPos(playerid, X, Y, Z);
       CarroRC[playerid] = CreateVehicle(441,X, Y, Z,0.0,-1,-1,1000);
       PutPlayerInVehicle(playerid, CarroRC[playerid], 0);
       return 1;
    }
    return 0;
}
Reply
#7

Po kra, valeu ai, so +1 duvida

Se eu quiser fazer com que o player tenha q comprar o carro antes de Usar, eu vou colocar

CMD: /comprarRC

ai como eu faзo, se o player tiver com "CarroRC[playerid] = id do carro" , colocar pra ele controlar,
se n tiver, enviar mensagem falando q n tem carro

Vc sabe??
Reply
#8

Eu sou novatгo em pawn, mais tenta assim

Topo do GameMode

PHP код:
new bool:ComprouRC[MAX_PLAYERS]; 
Agora na public OnPlayerCommandText(playerid, cmdtext[])
PHP код:
if (strcmp("/controlarrc"cmdtexttrue10) == 0)
    {
       if(
ComprouRC[playerid] == false)
       {
          
SendClientMessage(playerid0xAFAFAFAA"Vocк nгo tem RC, use /ComprarRC");
          return 
true;
       }
       
SendClientMessage(playeridCOLOR_GREEN"Vocк ira controlar um carro RC");
       
GetPlayerPos(playeridXYZ);
       
CarroRC[playerid] = CreateVehicle(441,XYZ,0.0,-1,-1,1000);
       
PutPlayerInVehicle(playeridCarroRC[playerid], 0);
       return 
1;
    }
    return 
0;

Agora o /ComprarRC
PHP код:
if (strcmp("/comprarrc"cmdtexttrue10) == 0)
    {
     
ComprouRC[playerid] = true;
     
// Funзхes
     
return 1;
    } 
Se te ajudei, deкm representaзгo, dando-me reputation.
Reply
#9

vo testar aki perae
Reply
#10

VC EH NOVATO MESMO? KKK Q ESTRANHO, VLW AE MANOW,

TA DE PARABENS!

+REP!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)