SA-MP Forums Archive
[Ajuda] Oque tem de errado neste comando? - 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] Oque tem de errado neste comando? (/showthread.php?tid=400427)



Oque tem de errado neste comando? - TheuziiN_ - 18.12.2012

Код:
if(strcmp(cmdtext,"/skydive",true)==0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
GameTextForPlayer(playerid,"Sky Dive ._,",4000,6);
LinkVehicleToInterior(vehicleid,0);
SetPlayerInterior(playerid,0);
return SetVehiclePos(vehicleid,3443.69995117,540.90002441,2014.00000000);
}
SetPlayerPos(playerid,3443.69995117,540.90002441,2014.00000000);
SetPlayerInterior(playerid,0);
GameTextForPlayer(playerid,"Sky Dive ._,",4000,6);
return 1;
}
Oque tem de errado?



Re: Oque tem de errado neste comando? - ViniBorn - 18.12.2012

pawn Код:
if(strcmp(cmdtext,"/skydive",true)==0)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        LinkVehicleToInterior(GetPlayerVehicleID(playerid),0);
        SetVehiclePos(GetPlayerVehicleID(playerid),3443.69995117,540.90002441,2014.00000000);
    }
    else SetPlayerPos(playerid,3443.69995117,540.90002441,2014.00000000);

    GameTextForPlayer(playerid,"Sky Dive ._.",4000,6);
    SetPlayerInterior(playerid,0);
    return true;
}



Re: Oque tem de errado neste comando? - TheuziiN_ - 18.12.2012

Olha os erros que deu '-'

Код:
(70698) : error 010: invalid function or declaration
(70700) : error 010: invalid function or declaration
(70705) : error 010: invalid function or declaration
(70707) : error 021: symbol already defined: "GameTextForPlayer"
(70709) : error 010: invalid function or declaration



Re: Oque tem de errado neste comando? - Q.I - 18.12.2012

pawn Код:
if(strcmp(cmdtext,"/skydive",true)==0)
{
        new vehicleid = GetPlayerVehicleID(playerid);
        new State = GetPlayerState(playerid);
        if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
        {
            LinkVehicleToInterior(vehicleid,0);
            SetVehiclePos(vehicleid,3443.69995117,540.90002441,2014.00000000);
        }
        else
        {
                SetPlayerPos(playerid,3443.69995117,540.90002441,2014.00000000);
        }
        SetPlayerInterior(playerid,0);
        GameTextForPlayer(playerid,"Sky Dive ._,",4000,6);
        return true;
}



Re: Oque tem de errado neste comando? - dPlaYer_ - 18.12.2012

pawn Код:
if(strcmp(cmdtext,"/skydive",true)==0)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        LinkVehicleToInterior(GetPlayerVehicleID(playerid),0);
        SetVehiclePos(GetPlayerVehicleID(playerid),3443.69995117,540.90002441,2014.00000000);
    }
    else
    {

        SetPlayerPos(playerid,3443.69995117,540.90002441,2014.00000000);
        GameTextForPlayer(playerid,"Sky Dive ._.",4000,6);
        SetPlayerInterior(playerid,0);
    }
    return true;
}



Re: Oque tem de errado neste comando? - BielCOP - 18.12.2012

O jeito mais completo:

pawn Код:
if(strcmp(cmd,"/skydive",true) == 0)
{
          if(IsPlayerConnected(playerid))
          {
                    if(IsPlayerInAnyVehicle(playerid))
                    {
                              new vehicleid = GetPlayerVehicleID(playerid);

                              SetVehiclePos(vehicleid,3443.60,541.0,2015.0);

                              SendClientMessage(playerid,0xBFBFBFAA,"Bem vindo ao Sky Dive! Vocк veio com um veнculo.");

                              return 1;
                    }
                    else
                    {
                              SetPlayerPos(playerid,3443.60,541.0,2015.0);

                              SendClientMessage(playerid,0xBFBFBFAA,"Bem vindo ao Sky Dive! Vocк veio apй.");

                              return 1;
                    }
          }
          return 1;
}