[Ajuda] Alguns erros que estб acontecendo.
#1

Bom, eu estou criando um sistema de entrar/sair de interior fiz um sу para treinar mesmo ver o que ia sair e tal, mais depois que eu fiz ele deu alguns erros. Espero que alguйm possa me ajudar. ((Tentei resolver mais nгo consegui.))

ERROS:
Код:
C:\Users\Leilson\Desktop\Showtime DM Brazil\gamemodes\teste.pwn(99) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Leilson\Desktop\Showtime DM Brazil\gamemodes\teste.pwn(99) : error 010: invalid function or declaration
C:\Users\Leilson\Desktop\Showtime DM Brazil\gamemodes\teste.pwn(101) : error 010: invalid function or declaration
C:\Users\Leilson\Desktop\Showtime DM Brazil\gamemodes\teste.pwn(106) : error 010: invalid function or declaration
C:\Users\Leilson\Desktop\Showtime DM Brazil\gamemodes\teste.pwn(108) : error 010: invalid function or declaration
C:\Users\Leilson\Desktop\Showtime DM Brazil\gamemodes\teste.pwn(178) : warning 217: loose indentation
C:\Users\Leilson\Desktop\Showtime DM Brazil\gamemodes\teste.pwn(219) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Vou postar o GAMEMODE inteiro, nesse GAMEMODE sу tem esse sistema mesmo.

CУDIGO:
pawn Код:
//----------------------------------------------------------------------------//
#include <a_samp>

//----------------------------------------------------------------------------//


//----------------------------------------------------------------------------//

new EntradaPickup;
new SaidaPickup;
//----------------------------------------------------------------------------//
main()
{

    print(" ");
    print("    Showtime DM Brazil | Versгo: 1.0.1");
    print("        Gamemode carregado com sucesso!");
    print("          Olб, seja muito bem vindo!");
    print(" ");

}
public OnGameModeInit()
{
    SetGameModeText("Versгo 1.0.1");
    AddPlayerClass(0, 1642.1667, -2335.4941, 13.5469, 7.6790, 0, 0, 0, 0, 0, 0);
    EntradaPickup = CreatePickup(1314, 2, 2045.0410, -1908.0431, 13.5469, -1);
    SaidaPickup = CreatePickup(1239, 2, 1494.3314, 1303.5787, 1093.2891, -1);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1094.0081,-934.7470,1000.0987);
    SetPlayerCameraPos(playerid, 1094.0081,-934.7470,157.0987);
        SetPlayerCameraLookAt(playerid, 1190.5789,-1060.4253,76.4776);
    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, "/entrar", true) == 0)
{
   if(IsPlayerInRangeOfPoint(playerid, 2.0, 2695.6880, -1704.6300, 11.8438))
   {
       SetPlayerPos(playerid, 1494.325195,1304.942871,1093.289062);
       SetPlayerInterior(playerid, 3);
   }
   return true;
}

if(strcmp(cmdtext, "/sair", true) == 0)
{
   if(IsPlayerInRangeOfPoint(playerid, 2.0, 1494.325195,1304.942871,1093.289062))
   {
      SetPlayerPos(playerid, 2695.6880, -1704.6300, 11.8438);
      SetPlayerInterior(playerid, 0);
   }
   return true; // Returnando a 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)
{
if(pickupid == EntradaPickup)
{
     SetPlayerInterior(playerid, 3);
     SetPlayerPos(playerid, 1494.3314, 1303.5787, 1093.2891);
}
if(pickupid == SaidaPickup)
{
     SetPlayerInterior(playerid, 0);
     SetPlayerPos(playerid, 1503.3359, 1432.3585, 10.1191);
}
    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)
{
if ((newkeys==KEY_SECONDARY_ATTACK))
{
   OnPlayerCommandText(playerid,"/entrar");
   OnPlayerCommandText(playerid,"/sair");

}
    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;
}
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/entrar", true) == 0)
    {
       if(IsPlayerInRangeOfPoint(playerid, 2.0, 2695.6880, -1704.6300, 11.8438))
       {
            SetPlayerPos(playerid, 1494.325195,1304.942871,1093.289062);
            SetPlayerInterior(playerid, 3);
       }
       return true;
    }
    if(strcmp(cmdtext, "/sair", true) == 0)
    {
       if(IsPlayerInRangeOfPoint(playerid, 2.0, 1494.325195,1304.942871,1093.289062))
       {
           SetPlayerPos(playerid, 2695.6880, -1704.6300, 11.8438);
           SetPlayerInterior(playerid, 0);
       }
       return true; // Returnando a 1
    }
    return false;
}
Reply
#3

Quote:
Originally Posted by Jonathan_Feitosa
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/entrar", true) == 0)
    {
       if(IsPlayerInRangeOfPoint(playerid, 2.0, 2695.6880, -1704.6300, 11.8438))
       {
            SetPlayerPos(playerid, 1494.325195,1304.942871,1093.289062);
            SetPlayerInterior(playerid, 3);
       }
       return true;
    }
    if(strcmp(cmdtext, "/sair", true) == 0)
    {
       if(IsPlayerInRangeOfPoint(playerid, 2.0, 1494.325195,1304.942871,1093.289062))
       {
           SetPlayerPos(playerid, 2695.6880, -1704.6300, 11.8438);
           SetPlayerInterior(playerid, 0);
       }
       return true; // Returnando a 1
    }
    return false;
}
Coloquei esse cуdigo e tiro alguns erros e apareceu esses.
Код:
C:\Users\Leilson\Desktop\Showtime DM Brazil\gamemodes\teste.pwn(169) : warning 217: loose indentation
C:\Users\Leilson\Desktop\Showtime DM Brazil\gamemodes\teste.pwn(210) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Erro na " return 1 "

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == EntradaPickup)
{
     SetPlayerInterior(playerid, 3);
     SetPlayerPos(playerid, 1494.3314, 1303.5787, 1093.2891);
}
if(pickupid == SaidaPickup)
{
     SetPlayerInterior(playerid, 0);
     SetPlayerPos(playerid, 1503.3359, 1432.3585, 10.1191);
}
    return 1;
}
Erro na "return" tambйm.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys==KEY_SECONDARY_ATTACK))
{
   OnPlayerCommandText(playerid,"/entrar");
   OnPlayerCommandText(playerid,"/sair");

}
    return 1;
}
Reply
#4

Edit: Oops
Reply
#5

Pronto, jб conseguir arrumar. Esses outros dois cуdigos que passei nгo estavam de uma forma correta. (( Bom, jб й um comeзo para mim, conseguir arrumar alguns cуdigos. Graзas ao Jonathan *--* ))
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)