SA-MP Forums Archive
[ajuda] resolver erros do pawn me ajuda aqui! - 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] resolver erros do pawn me ajuda aqui! (/showthread.php?tid=307419)



[ajuda] resolver erros do pawn me ajuda aqui! - |_Lucas_| - 30.12.2011

Quote:

C:\Documents and Settings\Lucas\Desktop\hit.pwn(91) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Lucas\Desktop\hit.pwn(93) : error 017: undefined symbol "PlayerToPoint"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#define COR_AZUL 0x00FFFFAA
#define COLOR_GREEN 0x00FF00AA

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	CreatePickup(1242, 1, 405.85,2541.47,16.55);
	Create3DTextLabel(".::Equipamentos::.\n/equiparh", COR_AZUL, 1553.6526,-1675.6404,16.1953, 25, 0, 50);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	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[])
{
	if(strcmp(cmd, "/equiparh", true) == 0)
 	{
    	if(PlayerToPoint(10.0, playerid,709.9501,-448.9526,16.3359))
    	{
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid, 24, 399);
            GivePlayerWeapon(playerid, 30, 999);
            GivePlayerWeapon(playerid, 29, 999);
            GivePlayerWeapon(playerid, 4, 1);
            GivePlayerWeapon(playerid, 34, 199);
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 100);
            SendClientMessage(playerid,COLOR_GREEN,"Voce pegou o seu equipamento!");
            return 1;
        }
    }
	return 0;
}
alguem me ajuda a resolver esse erro


Re: [ajuda] resolver erros do pawn me ajuda aqui! - rjjj - 30.12.2011

Isto deve resolver o seu problema .


pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#define COR_AZUL 0x00FFFFAA
#define COLOR_GREEN 0x00FF00AA

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    CreatePickup(1242, 1, 405.85,2541.47,16.55);
    Create3DTextLabel(".::Equipamentos::.\n/equiparh", COR_AZUL, 1553.6526,-1675.6404,16.1953, 25, 0, 50);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    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[])
{
    if(strcmp(cmdtext, "/equiparh", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,709.9501,-448.9526,16.3359))
        {
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid, 24, 399);
            GivePlayerWeapon(playerid, 30, 999);
            GivePlayerWeapon(playerid, 29, 999);
            GivePlayerWeapon(playerid, 4, 1);
            GivePlayerWeapon(playerid, 34, 199);
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 100);
            SendClientMessage(playerid,COLOR_GREEN,"Voce pegou o seu equipamento!");
        }
        return 1;
    }
    return 0;
}


Espero ter ajudado .


Re: [ajuda] resolver erros do pawn me ajuda aqui! - |_Lucas_| - 30.12.2011

rjjj vlw cara so 1 problema a pickup e a 3dtext nao aparece


Re: [ajuda] resolver erros do pawn me ajuda aqui! - jefe10 - 30.12.2011

Ao inves de
if(strcmp(cmd, "/equiparh", true) == 0) use:
if(strcmp(cmdtext,"/equiparh",true)==0)
e tambem troque
if(IsPlayerInRangeOfPoint(playerid,10.0,709.9501,-448.9526,16.3359) por: if(IsPlayerInRangeOfPoint(playerid,10.0,709.9501,-448.9526,16.3359)



Re: [ajuda] resolver erros do pawn me ajuda aqui! - rjjj - 30.12.2011

Quote:
Originally Posted by |_Lucas_|
Посмотреть сообщение
rjjj vlw cara so 1 problema a pickup e a 3dtext nao aparece
Testei o cуdigo aqui e eles apareceram .



Talvez vocк esteja carregando um Filterscript ou algo do tipo que utilize muitas Pickups e Textos 3D a ponto de ultrapassar a quantidade mбxima permitida desses elementos .



Espero ter ajudado .