[Pomoc]Warning i Error

Započeo SpawneR., Januar 31, 2013, 21:27:21 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: od 0
Detaljan opis problema: Baca mi neki error a nije mi jasno zasto
Dio skripte:

Ovo mi baca:
d:\My Documents\Desktop\Burn Gaming Roleplay\gamemodes\GG.pwn(2964) : warning 209: function "S@@_OnPlayerStateChange" should return a value
d:\My Documents\Desktop\Burn Gaming Roleplay\gamemodes\GG.pwn(2965) : error 010: invalid function or declaration


error mi baca na ovu liniju :

return 1;

a warning baca na ceo taj public.. :

public OnPlayerStateChange(playerid, newstate, oldstate)
{
new idv = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloKosaca(idv))
{
    if(PlayerInfo[playerid][pPosao] == 1) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloGrobara(idv))
{
    if(PlayerInfo[playerid][pPosao] == 2) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloPostara(idv))
{
    if(PlayerInfo[playerid][pPosao] == 3) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloPizza(idv))
{
    if(PlayerInfo[playerid][pPosao] == 4) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloSmecara(idv))
{
    if(PlayerInfo[playerid][pPosao] == 5) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloMlekara(idv))
{
    if(PlayerInfo[playerid][pPosao] == 6) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloRnovina(idv))
{
    if(PlayerInfo[playerid][pPosao] == 7) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloNafta(idv))
{
    if(PlayerInfo[playerid][pPosao] == 8) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloSex(idv))
{
    if(PlayerInfo[playerid][pPosao] == 9) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloBus(idv))
{
    if(PlayerInfo[playerid][pPosao] == 10) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloRoba(idv))
{
    if(PlayerInfo[playerid][pPosao] == 11) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloOdeca(idv))
{
    if(PlayerInfo[playerid][pPosao] == 12) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if (newstate == PLAYER_STATE_DRIVER) // Ako je usao u vozilo kao vozac
{

// Provjerava da li je igrac usao u vozilo org. LSPD i provjerava da li je clan te org., ako nije izbacit ce ga iz vozila
if (VoziloGsf(idv))
{
if(PlayerInfo[playerid][pMember] == 1 )
if(PlayerInfo[playerid][pLeader] == 1) {}
else
{
SendClientMessage(playerid, C_WHITE, "ERROR: Nisi clan GSF-a.");

RemovePlayerFromVehicle(playerid);
}
}
}
if( newstate == KEY_SECONDARY_ATTACK ) // GSF ULAZ
{
if( IsPlayerInRangeOfPoint(playerid, 3.0, 2495.1350,-1690.3324,14.7656))
{
SetPlayerPos(playerid, 2527.654052,-1679.388305,1015.498596);
SetPlayerInterior( playerid, 1 );
GameTextForPlayer( playerid, "GSF chill place.", 3000, 1 );
return 1;
}
}
if( newstate == KEY_SECONDARY_ATTACK ) // GSF IZLAZ
{
if( IsPlayerInRangeOfPoint(playerid, 3.0, 2527.654052,-1679.388305,1015.498596))
SetPlayerPos(playerid, 2495.1350,-1690.3324,14.7656);
SetPlayerInterior( playerid, 0);
GameTextForPlayer( playerid, "Los Santos", 3000, 1 );
return 1;
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): Ko bi reko cuda da se dese da miljacka bokove odnese!

Evo:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new idv = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloKosaca(idv))
{
    if(PlayerInfo[playerid][pPosao] == 1) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloGrobara(idv))
{
    if(PlayerInfo[playerid][pPosao] == 2) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloPostara(idv))
{
    if(PlayerInfo[playerid][pPosao] == 3) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloPizza(idv))
{
    if(PlayerInfo[playerid][pPosao] == 4) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloSmecara(idv))
{
    if(PlayerInfo[playerid][pPosao] == 5) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloMlekara(idv))
{
    if(PlayerInfo[playerid][pPosao] == 6) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloRnovina(idv))
{
    if(PlayerInfo[playerid][pPosao] == 7) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloNafta(idv))
{
    if(PlayerInfo[playerid][pPosao] == 8) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloSex(idv))
{
    if(PlayerInfo[playerid][pPosao] == 9) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloBus(idv))
{
    if(PlayerInfo[playerid][pPosao] == 10) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloRoba(idv))
{
    if(PlayerInfo[playerid][pPosao] == 11) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if(newstate == PLAYER_STATE_DRIVER)
{
if(VoziloOdeca(idv))
{
    if(PlayerInfo[playerid][pPosao] == 12) {}
    else
    {
      RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
    }
}
if (newstate == PLAYER_STATE_DRIVER) // Ako je usao u vozilo kao vozac
{

// Provjerava da li je igrac usao u vozilo org. LSPD i provjerava da li je clan te org., ako nije izbacit ce ga iz vozila
if (VoziloGsf(idv))
{
if(PlayerInfo[playerid][pMember] == 1 )
if(PlayerInfo[playerid][pLeader] == 1) {}
else
{
SendClientMessage(playerid, C_WHITE, "ERROR: Nisi clan GSF-a.");

RemovePlayerFromVehicle(playerid);
}
}
}
if( newstate == KEY_SECONDARY_ATTACK ) // GSF ULAZ
{
if( IsPlayerInRangeOfPoint(playerid, 3.0, 2495.1350,-1690.3324,14.7656))
{
SetPlayerPos(playerid, 2527.654052,-1679.388305,1015.498596);
SetPlayerInterior( playerid, 1 );
GameTextForPlayer( playerid, "GSF chill place.", 3000, 1 );
return 1;
}
}
if( newstate == KEY_SECONDARY_ATTACK ) // GSF IZLAZ
{
if( IsPlayerInRangeOfPoint(playerid, 3.0, 2527.654052,-1679.388305,1015.498596))
SetPlayerPos(playerid, 2495.1350,-1690.3324,14.7656);
SetPlayerInterior( playerid, 0);
GameTextForPlayer( playerid, "Los Santos", 3000, 1 );
return 1;
}
return 1;
}

Last nick: Paradox

Hvala , a jel bi mogo da mi kazes gde sam pogresio ? Znas ucim jos uvek pa da znam  :)

Zatvorio si callback prije zadnjeg returna, tj. imao si jednu vitičastu zagradu previše. Usporedi moj i svoj kod i vidjet ćeš.

Last nick: Paradox

Vidim.. ali sada dodjem na tu kordinatu i nece da udje u int?

Te dvije if provjere Å¡to si dodao na kraj callback, ne idu u taj callback nego u OnPlayerKeyStateChange callback.

Last nick: Paradox

O moj boze , ja se sve tripujem da je to taj callback  :D LOCK