[Ajuda] Resolver alguns erros
#1

Olб a todos! E gostaria que alguйm me ajudasse a resolver alguns erros que estгo me atormentando nesses ъltimos dias.
A seguir o meu cуdigo e as mensagens de erro:
Код:
#include <a_samp>
#include <a_http>
#include <a_npc>
#include <a_objects>
#include <a_players>
#include <a_sampdb>
#include <a_vehicles>
#include <core>
#include <datagram>
#include <file>
#include <float>
#include <streamer>
#include <string>
#include <time>
#include <Dini>

#if defined FILTERSCRIPT

//CORES ORG'S
#define Taxista              													0

//NUMEROS ORG'S
#define C_Taxista																0xFF0000AA

//SALARIOS
#define Salario_Taxista                                                         1500

new Profissao[MAX_PLAYERS];

main()
{
	print("\n-----------------------------------------");
	print(" Game-Mode feito por Rafael Osio de Vargas");
	print("-------------------------------------------\n");
}

#endif

public OnGameModeInit()
{



	// MOTOS SPAWN CIVIL
    CreateVehicle(462,1099.4965,-1775.7457,13.3444,90.0,129,129,60);
	CreateVehicle(462,1099.4965,-1772.7457,13.3444,90.0,129,129,60);
	CreateVehicle(462,1099.4965,-1769.7457,13.3489,90.0,129,129,60);
	CreateVehicle(462,1099.4965,-1766.7457,13.3444,90.0,129,129,60);
	CreateVehicle(462,1099.4965,-1763.7457,13.3444,90.0,129,129,60);
	CreateVehicle(462,1099.4965,-1760.7457,13.3444,90.0,129,129,60);
	CreateVehicle(462,1099.4965,-1757.7457,13.3444,90.0,129,129,60);
	CreateVehicle(462,1099.4965,-1754.7457,13.3444,90.0,129,129,60);
	
	// BICICLETAS SPAWN CIVIL
	CreateVehicle(481,1083.3788,-1754.7457,13.3444,270.0,129,129,60);
	CreateVehicle(481,1083.3788,-1757.7457,13.3444,270.0,129,129,60);
	CreateVehicle(481,1083.3788,-1760.7457,13.3444,270.0,129,129,60);
	CreateVehicle(481,1083.3788,-1763.7457,13.3444,270.0,129,129,60);
	CreateVehicle(481,1083.3788,-1766.7457,13.3444,270.0,129,129,60);
	CreateVehicle(481,1083.3788,-1769.7457,13.3444,270.0,129,129,60);
	CreateVehicle(481,1083.3788,-1772.7457,13.3444,270.0,129,129,60);
	CreateVehicle(481,1083.3788,-1775.7457,13.3444,270.0,129,129,60);
    
    // INICIO DO SERVIDOR
	SetGameModeText("Rafa Mode");
	AddPlayerClass(0,1110.3138,-1794.9937,16.5938,87.6616,0,0,0,0,0,0);
	
	//PICKUP DE ENTRADA NA PREF
	CreatePickup(1318,0,1481.1169,-1771.7590,18.7958,-1);
	
	//PICKUP DA SAIDA DA PREF
	CreatePickup(1318,0,389.9258,173.9278,1008.3828,-1);

	//DESABILITA A SETINHA AMARELA NA ENTRADA DOS INTERIORES
	DisableInteriorEnterExits();
	
	
	
	
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1513.3488,-1715.2562,14.0469);
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	//INTERIOR PREF - ENTRADA
    if (strcmp("/entrarnointeriorprefeiturals", cmdtext, true, 10) == 0)
	{
  
        if(IsPlayerInRangeOfPoint(playerid, 2.0,1481.1484,-1770.3508,18.7958))
    {
        SetPlayerInterior(playerid, 3); // Interior Do Local que Serб Setado.
     	SetPlayerPos(playerid,387.6299,173.7600,1008.3828); // Setando ele Para Dentro do Interior.
    }
		return 1;
	}
	


	//INTERIOR PREF - SAIDA
    if (strcmp("/sairdointeriorprefeiturals", cmdtext, true, 10) == 0)
	{

        if(IsPlayerInRangeOfPoint(playerid, 2.0,389.9258,173.9278,1008.3828))
    {
        SetPlayerInterior(playerid, 0); // Interior Do Local que Serб Setado.
     	SetPlayerPos(playerid,1480.7925,-1767.8843,18.7958); // Setando ele Para Dentro do Interior.
    }
		return 1;
	}


	//PROFISSAO TAXISTA
	if(strcmp(cmdtext,"/minhaprofissao", true) == 0)
    {
        if(Profissao[playerid] == TAXISTA)
        {
            SendClientMessage(playerid,cor_cinza,"VC E TAXISTA");
        }
        else
        {
        SendClientMessage(playerid,cor_cinza,"VC NUM E TAXISTA");
        }
    return 1;
    }









	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{

	//APERTAR F PARA ENTRAR/SAIR DA PREF
    if ((newkeys==KEY_SECONDARY_ATTACK))
	{
    OnPlayerCommandText(playerid,"/entrarnointeriorprefeiturals");
	}
	
	//APERTAR F PARA ENTRAR/SAIR DA PREF
    if ((newkeys==KEY_SECONDARY_ATTACK))
	{
    OnPlayerCommandText(playerid,"/sairdointeriorprefeiturals");
	}
	
	
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
Mensagens de erro:
Код:
C:\Users\Rafael\Desktop\Serv SAMP\gamemodes\gmrafa.pwn(162) : error 017: undefined symbol "Profissao"
C:\Users\Rafael\Desktop\Serv SAMP\gamemodes\gmrafa.pwn(162) : warning 215: expression has no effect
C:\Users\Rafael\Desktop\Serv SAMP\gamemodes\gmrafa.pwn(162) : error 001: expected token: ";", but found "]"
C:\Users\Rafael\Desktop\Serv SAMP\gamemodes\gmrafa.pwn(162) : error 029: invalid expression, assumed zero
C:\Users\Rafael\Desktop\Serv SAMP\gamemodes\gmrafa.pwn(162) : 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 do erro:
Код:
if(Profissao[playerid] == TAXISTA)
Por favor, me ajudem...



OBS.: Sou novato em Pawn, nгo sei praticamente nada, mas estou disposto a aprender qualquer coisa que seja ligado a esta linguagem.
OBS№.:Por favor, nгo me critiquem. Por exemplo: "Se vocк nгo sabe resolver este problema fбcil de se resolver, nгo continue a programar.
OBSІ.:Eu nгo curto muito esses comentбrios que desestimule a pessoa...
Reply
#2

da uma olhada neste codigo

pawn Код:
#include <a_samp>
#include <streamer>
#include <Dini>
#include <zcmd>

//NUMEROS ORG'S
#define Taxista                                                                 0

//CORES ORG'S
#define C_Taxista                                                               0xFF0000AA

//SALARIOS
#define Salario_Taxista                                                         1500

new Profissao[MAX_PLAYERS];

main()
{
    print("\n-----------------------------------------");
    print(" Game-Mode feito por Rafael Osio de Vargas");
    print("-------------------------------------------\n");
}

public OnGameModeInit()
{
    // MOTOS SPAWN CIVIL
    CreateVehicle(462,1099.4965,-1775.7457,13.3444,90.0,129,129,60);
    CreateVehicle(462,1099.4965,-1772.7457,13.3444,90.0,129,129,60);
    CreateVehicle(462,1099.4965,-1769.7457,13.3489,90.0,129,129,60);
    CreateVehicle(462,1099.4965,-1766.7457,13.3444,90.0,129,129,60);
    CreateVehicle(462,1099.4965,-1763.7457,13.3444,90.0,129,129,60);
    CreateVehicle(462,1099.4965,-1760.7457,13.3444,90.0,129,129,60);
    CreateVehicle(462,1099.4965,-1757.7457,13.3444,90.0,129,129,60);
    CreateVehicle(462,1099.4965,-1754.7457,13.3444,90.0,129,129,60);
   
    // BICICLETAS SPAWN CIVIL
    CreateVehicle(481,1083.3788,-1754.7457,13.3444,270.0,129,129,60);
    CreateVehicle(481,1083.3788,-1757.7457,13.3444,270.0,129,129,60);
    CreateVehicle(481,1083.3788,-1760.7457,13.3444,270.0,129,129,60);
    CreateVehicle(481,1083.3788,-1763.7457,13.3444,270.0,129,129,60);
    CreateVehicle(481,1083.3788,-1766.7457,13.3444,270.0,129,129,60);
    CreateVehicle(481,1083.3788,-1769.7457,13.3444,270.0,129,129,60);
    CreateVehicle(481,1083.3788,-1772.7457,13.3444,270.0,129,129,60);
    CreateVehicle(481,1083.3788,-1775.7457,13.3444,270.0,129,129,60);
   
    // INICIO DO SERVIDOR
    SetGameModeText("Rafa Mode");
    AddPlayerClass(0,1110.3138,-1794.9937,16.5938,87.6616,0,0,0,0,0,0);
   
    //PICKUP DE ENTRADA NA PREF
    CreatePickup(1318,0,1481.1169,-1771.7590,18.7958,-1);
   
    //PICKUP DA SAIDA DA PREF
    CreatePickup(1318,0,389.9258,173.9278,1008.3828,-1);

    //DESABILITA A SETINHA AMARELA NA ENTRADA DOS INTERIORES
    DisableInteriorEnterExits();   
    return 1;
}

// COMANDOS
CMD:profissao(playerid)
{
    if(Profissao[playerid] == TAXISTA)
        SendClientMessage(playerid,cor_cinza,"VC E TAXISTA");
       
    else SendClientMessage(playerid,cor_cinza,"VC NUM E TAXISTA");
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{

    //APERTAR F PARA ENTRAR/SAIR DA PREF
    if ((newkeys==KEY_SECONDARY_ATTACK))
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0,1481.1484,-1770.3508,18.7958))
        {
            SetPlayerInterior(playerid, 3); // Interior Do Local que Serб Setado.
            SetPlayerPos(playerid,387.6299,173.7600,1008.3828); // Setando ele Para Dentro do Interior.
        }
        // else if.......
    }
   
    //APERTAR F PARA ENTRAR/SAIR DA PREF
    if ((newkeys==KEY_SECONDARY_ATTACK))
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0,389.9258,173.9278,1008.3828))
        {
            SetPlayerInterior(playerid, 0); // Interior Do Local que Serб Setado.
            SetPlayerPos(playerid,1480.7925,-1767.8843,18.7958); // Setando ele Para Dentro do Interior.
        }
    }
    return 1;
}
recomendo usar zcmd ou ycmd para os comandos de qualquer forma apliquei zcmd.

olha o link da include: forum.sa-mp.com/showthread.php?t=91354
Reply
#3

Obrigado amigo. Vou testar aqui e jaja lhe dou uma resposta.
Reply
#4

acho que vc esqueзeu de fechar algum coisa
Reply
#5

Po cara, muito obrigado velho. Vocк conseguiu me ajudar.
Era apenas eu incluir a zcmd.
Deu certinho velho. Muito obrigado novamente
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)