[Ajuda] Ajudem com 15 erros :S
#1

O

PHP код:
C:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(64) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(66) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(69) : error 021symbol already defined"GetPlayerName"
C:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(72) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(75) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(77) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(79) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(80) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(81) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(84) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(85) : error 021symbol already defined"SendClientMessage"
C:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(87) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(87 -- 89) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(87 -- 90) : error 010invalid function or declaration
C
:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(87 -- 90) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
15 Errors

Meu gamemode completo.... :

PHP код:
//-------------------------------------------------ROLE PLAY BY DaYviSoN---------------------------------------------//
#include <a_samp>
#if defined FILTERSCRIPT
#else
//Tela que aparece no samp-server. (Quando se liga o servidor)
main()
{
    print(
" ");
    print(
"_______________________________________________________________");
    print(
"Estado do Servidor: ");
    print(
"O Servidor foi ligado com sucesso! Estб Pronto a ser Utilizado.");
    print(
"_______________________________________________________________");
    print(
" ");
}
#endif
public OnGameModeInit()
{
    
// Modo de Jogo
    
SetGameModeText("RolePlay v1.0");
    
//Player
    
AddPlayerClass(0, -767.3870,1499.8663,24.7051269.1425000000);
    
// Veiculos
    
AddStaticVehicle(431,-774.5818,1444.2756,13.8953,77.9480,47,74);
    
AddStaticVehicle(431,-774.1534,1428.5939,13.8890,102.9080,47,74);
    
AddStaticVehicle(574,-791.8569,1445.9147,13.5142,78.0698,26,26);
    
AddStaticVehicle(574,-791.9972,1427.2260,13.5142,104.1815,26,26);
    
AddStaticVehicle(574,-806.3814,1446.4915,13.5142,76.4160,26,26);
    
AddStaticVehicle(574,-806.3204,1427.0098,13.5142,103.9668,26,26);
    
AddStaticVehicle(599,-221.1601,1005.3596,19.8951,180.0661,0,1);
    
AddStaticVehicle(525,-216.7263,1005.1966,19.6012,182.4167,52,54);
    return 
1;
}
public 
OnGameModeExit()
{
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/comandos"true))
    {
        
SendClientMessage(playerid0xFFFFFFFF"--------------------------------Comandos--------------------------");
        
SendClientMessage(playerid0xFFFFFFFF"                                                                  ");
        
SendClientMessage(playerid0xFFFFFFFF"--------------------------------Comandos--------------------------");
        return 
1;
        
// Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
    
}
    return 
0;
    
// Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
}
if(
strcmp(cmdtext"/comprarcarro"true) == 0) {
new 
VehicleID;
VehicleID GetPlayerVehicleID(playerid);
new 
pname[MAX_PLAYER_NAME];
new 
aname[MAX_PLAYER_NAME];
GetPlayerName(playeridanamesizeof(aname));
GetPlayerName(playeridpnamesizeof(pname));
format(filesizeof(file), PASTA_CONTASaname);
for(new 
carro 0carro MAX_CARROScarro++)
{
format(stringsizeof(string), "carro%d.ini"carro);
if(
strcmp(dini_Get(string"Dono"), pnametrue) == 0){
SendClientMessage(playeridVermelho"Vocк jб tem um carro");
return 
1;
}
if(
IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == && VehicleID == dini_Int(string"Id")){
if(
dini_Int(string,"TDono") == 1) return SendClientMessage(playeridVermelho,"Esse Carro jб tem dono!");
if(
GetPlayerGrana(playerid) >= dini_Int(string"Preco")){
GetPlayerName(playeridanameMAX_PLAYER_NAME);
dini_IntSet(string"TDono"1);
dini_Set(string"Dono"aname);
SendClientMessage(playeridVioleta"(INFO) Veiculo comprado com sucesso!");
SendClientMessage(playeridVermelho"(INFO) Para ver os comandos do veiculo, use: /meucarro");
GivePlayerGrana(playerid, -dini_Int(string"Preco"));
TogglePlayerControllable(playerid3);
return 
1;
} else {
SendClientMessage(playeridVermelho"(ERRO) Vocк nгo tem dinheiro suficiente!");
return 
1;
}
}
}
}
    
public 
OnPlayerConnect(playerid)
{
    new 
string[64], pName[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    
format(string,sizeof string,"%s entrou no servidor!",pName);
    
SendClientMessageToAll(0xFFFFFFAA,string);
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new
        
string[64],
        
name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(
reason)
    {
        case 
0format(string,sizeof string,"%s saiu do servidor. (Problema de Conexгo)",name);
        case 
1format(string,sizeof string,"%s saiu do servidor. (Saiu)",name);
        case 
2format(string,sizeof string,"%s saiu do servidor. (Kick/Ban)",name);
    }
    
SendClientMessageToAll(0xFFFFFFAA,string);
    return 
1;

A linha do erro comeзao em
PHP код:
if(strcmp(cmdtext"/comprarcarro"true) == 0) { 
Reply
#2

ce deixou alguma public ou function aberta... n da pra ter certeza nem saber ql й pq to on pelo cel, mas a rapazeada vai te ajudar.
Reply
#3

return 0;
// Returning 0 informs the server that the command hasn't been processed by this script.
// OnPlayerCommandText will be called in other scripts until one returns 1.
// If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
}
retire e meta antes d alinha OnPlayerDisconnect
Reply
#4

meta assim
pawn Код:
//-------------------------------------------------ROLE PLAY BY DaYviSoN---------------------------------------------//

#include <a_samp>

#if defined FILTERSCRIPT

#else

//Tela que aparece no samp-server. (Quando se liga o servidor)

main()
{
    print(" ");
    print("_______________________________________________________________");
    print("Estado do Servidor: ");
    print("O Servidor foi ligado com sucesso! Estб Pronto a ser Utilizado.");
    print("_______________________________________________________________");
    print(" ");
}

#endif

public OnGameModeInit()
{
    // Modo de Jogo
    SetGameModeText("RolePlay v1.0");
    //Player
    AddPlayerClass(0, -767.3870,1499.8663,24.7051, 269.1425, 0, 0, 0, 0, 0, 0);
    // Veiculos
    AddStaticVehicle(431,-774.5818,1444.2756,13.8953,77.9480,47,74);
    AddStaticVehicle(431,-774.1534,1428.5939,13.8890,102.9080,47,74);
    AddStaticVehicle(574,-791.8569,1445.9147,13.5142,78.0698,26,26);
    AddStaticVehicle(574,-791.9972,1427.2260,13.5142,104.1815,26,26);
    AddStaticVehicle(574,-806.3814,1446.4915,13.5142,76.4160,26,26);
    AddStaticVehicle(574,-806.3204,1427.0098,13.5142,103.9668,26,26);
    AddStaticVehicle(599,-221.1601,1005.3596,19.8951,180.0661,0,1);
    AddStaticVehicle(525,-216.7263,1005.1966,19.6012,182.4167,52,54);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])

{
    if(!strcmp(cmdtext, "/comandos", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "--------------------------------Comandos--------------------------");
        SendClientMessage(playerid, 0xFFFFFFFF, "                                                                  ");
        SendClientMessage(playerid, 0xFFFFFFFF, "--------------------------------Comandos--------------------------");
        return 1;
        // Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
    }
   

    if(strcmp(cmdtext, "/comprarcarro", true) == 0){
    new VehicleID;
    VehicleID = GetPlayerVehicleID(playerid);
    new pname[MAX_PLAYER_NAME];
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, sizeof(aname));
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), PASTA_CONTAS, aname);
    for(new carro = 0; carro < MAX_CARROS; carro++)
    {
    format(string, sizeof(string), "carro%d.ini", carro);
    if(strcmp(dini_Get(string, "Dono"), pname, true) == 0){
    SendClientMessage(playerid, Vermelho, "Vocк jб tem um carro");
    return 1;
    }
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0 && VehicleID == dini_Int(string, "Id")){
    if(dini_Int(string,"TDono") == 1) return SendClientMessage(playerid, Vermelho,"Esse Carro jб tem dono!");
    if(GetPlayerGrana(playerid) >= dini_Int(string, "Preco")){
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    dini_IntSet(string, "TDono", 1);
    dini_Set(string, "Dono", aname);
    SendClientMessage(playerid, Violeta, "(INFO) Veiculo comprado com sucesso!");
    SendClientMessage(playerid, Vermelho, "(INFO) Para ver os comandos do veiculo, use: /meucarro");
    GivePlayerGrana(playerid, -dini_Int(string, "Preco"));
    TogglePlayerControllable(playerid, 3);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem dinheiro suficiente!");
    return 1;
    }
    }
    }
    }
    return 0;
    // Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
    }
    public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s entrou no servidor!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new
        string[64],
        name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(reason)
    {
        case 0: format(string,sizeof string,"%s saiu do servidor. (Problema de Conexгo)",name);
        case 1: format(string,sizeof string,"%s saiu do servidor. (Saiu)",name);
        case 2: format(string,sizeof string,"%s saiu do servidor. (Kick/Ban)",name);
    }
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}
------------------
A linha:
pawn Код:
format(file, sizeof(file), PASTA_CONTAS, aname);
ta mal formatada
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])

{
    if(!strcmp(cmdtext, "/comandos", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "--------------------------------Comandos--------------------------");
        SendClientMessage(playerid, 0xFFFFFFFF, "                                                                  ");
        SendClientMessage(playerid, 0xFFFFFFFF, "--------------------------------Comandos--------------------------");
        return 1;
        // Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
    }
if(strcmp(cmdtext, "/comprarcarro", true) == 0) {
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
new pname[MAX_PLAYER_NAME];
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, sizeof(aname));
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), PASTA_CONTAS, aname);
for(new carro = 0; carro < MAX_CARROS; carro++)
{
format(string, sizeof(string), "carro%d.ini", carro);
if(strcmp(dini_Get(string, "Dono"), pname, true) == 0){
SendClientMessage(playerid, Vermelho, "Vocк jб tem um carro");
return 1;
}
if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0 && VehicleID == dini_Int(string, "Id")){
if(dini_Int(string,"TDono") == 1) return SendClientMessage(playerid, Vermelho,"Esse Carro jб tem dono!");
if(GetPlayerGrana(playerid) >= dini_Int(string, "Preco")){
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
dini_IntSet(string, "TDono", 1);
dini_Set(string, "Dono", aname);
SendClientMessage(playerid, Violeta, "(INFO) Veiculo comprado com sucesso!");
SendClientMessage(playerid, Vermelho, "(INFO) Para ver os comandos do veiculo, use: /meucarro");
GivePlayerGrana(playerid, -dini_Int(string, "Preco"));
TogglePlayerControllable(playerid, 3);
return 1;
} else {
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem dinheiro suficiente!");
return 1;
}
}
}
}
    return 0;
    // Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
}
Desculpa do jeito que eu postei (desorganizado), mas voce colocou uma strcmp fora de sua callback padrao.
Reply
#6

4 erros agora.

Quote:

C:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(5 : warning 217: loose indentation
C:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(65) : error 017: undefined symbol "file"
C:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(65) : error 017: undefined symbol "file"
C:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(65) : error 029: invalid expression, assumed zero
C:\Users\Bruno\Desktop\Meu GameMode\gamemodes\RP-SD.pwn(65) : fatal error 107: too many error messages on one line

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


4 Errors.

Reply
#7

pawn Код:
// topo do gm:

new file;
O mais recomendбvel seria voce trocar de file para File (com f maiusculo)
Reply
#8

Quote:
Originally Posted by BielCOP
Посмотреть сообщение
pawn Код:
// topo do gm:

new file;
O mais recomendбvel seria voce trocar de file para File (com f maiusculo)
new file[40];
Reply
#9

Ja meti (f) maiusculo e new fiile mas continua igual
Reply
#10

pawn Код:
//-------------------------------------------------ROLE PLAY BY DaYviSoN---------------------------------------------//

#include <a_samp>

#if defined FILTERSCRIPT

#else

//Tela que aparece no samp-server. (Quando se liga o servidor)

main()
{
    print(" ");
    print("_______________________________________________________________");
    print("Estado do Servidor: ");
    print("O Servidor foi ligado com sucesso! Estб Pronto a ser Utilizado.");
    print("_______________________________________________________________");
    print(" ");
}

#endif

public OnGameModeInit()
{
    // Modo de Jogo
    SetGameModeText("RolePlay v1.0");
    //Player
    AddPlayerClass(0, -767.3870,1499.8663,24.7051, 269.1425, 0, 0, 0, 0, 0, 0);
    // Veiculos
    AddStaticVehicle(431,-774.5818,1444.2756,13.8953,77.9480,47,74);
    AddStaticVehicle(431,-774.1534,1428.5939,13.8890,102.9080,47,74);
    AddStaticVehicle(574,-791.8569,1445.9147,13.5142,78.0698,26,26);
    AddStaticVehicle(574,-791.9972,1427.2260,13.5142,104.1815,26,26);
    AddStaticVehicle(574,-806.3814,1446.4915,13.5142,76.4160,26,26);
    AddStaticVehicle(574,-806.3204,1427.0098,13.5142,103.9668,26,26);
    AddStaticVehicle(599,-221.1601,1005.3596,19.8951,180.0661,0,1);
    AddStaticVehicle(525,-216.7263,1005.1966,19.6012,182.4167,52,54);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])

{
    if(!strcmp(cmdtext, "/comandos", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "--------------------------------Comandos--------------------------");
        SendClientMessage(playerid, 0xFFFFFFFF, "                                                                  ");
        SendClientMessage(playerid, 0xFFFFFFFF, "--------------------------------Comandos--------------------------");
        return 1;
        // Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
    }
   

    if(strcmp(cmdtext, "/comprarcarro", true) == 0){
    new VehicleID;
    VehicleID = GetPlayerVehicleID(playerid);
    new pname[MAX_PLAYER_NAME];
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, sizeof(aname));
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), PASTA_CONTAS, aname);
    for(new carro = 0; carro < MAX_CARROS; carro++)
    {
    format(string, sizeof(string), "carro%d.ini", carro);
    if(strcmp(dini_Get(string, "Dono"), pname, true) == 0){
    SendClientMessage(playerid, Vermelho, "Vocк jб tem um carro");
    return 1;
    }
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0 && VehicleID == dini_Int(string, "Id")){
    if(dini_Int(string,"TDono") == 1) return SendClientMessage(playerid, Vermelho,"Esse Carro jб tem dono!");
    if(GetPlayerGrana(playerid) >= dini_Int(string, "Preco")){
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    dini_IntSet(string, "TDono", 1);
    dini_Set(string, "Dono", aname);
    SendClientMessage(playerid, Violeta, "(INFO) Veiculo comprado com sucesso!");
    SendClientMessage(playerid, Vermelho, "(INFO) Para ver os comandos do veiculo, use: /meucarro");
    GivePlayerGrana(playerid, -dini_Int(string, "Preco"));
    TogglePlayerControllable(playerid, 3);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem dinheiro suficiente!");
    return 1;
    }
    }
    }
    }
    return 0;
    // Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown.
    }
    public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s entrou no servidor!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new
        string[64],
        name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(reason)
    {
        case 0: format(string,sizeof string,"%s saiu do servidor. (Problema de Conexгo)",name);
        case 1: format(string,sizeof string,"%s saiu do servidor. (Saiu)",name);
        case 2: format(string,sizeof string,"%s saiu do servidor. (Kick/Ban)",name);
    }
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}
meta assim que ta organizado... e use tbm isso :

pawn Код:
new File[50];
sim tens de criar apasta...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)