POMOC!!!

Započeo SARMA, Avgust 11, 2009, 10:35:03 PRE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Ja kad stavim ovo:
if(carid == 404 || carid == 405 || carid == 406)
{
if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11){ }
else
{
    SendClientMessage(playerid, COLOR_GREY, "  Nisi Licenser. !");
    RemovePlayerFromVehicle(playerid);
}

Dobijem ove erore:
C:\DOCUME~1\sarma\Desktop\SAMP02~1.WIN\GAMEMO~1\MSRP.pwn(2052) : error 010: invalid function or declaration
C:\DOCUME~1\sarma\Desktop\SAMP02~1.WIN\GAMEMO~1\MSRP.pwn(2054) : error 010: invalid function or declaration
C:\DOCUME~1\sarma\Desktop\SAMP02~1.WIN\GAMEMO~1\MSRP.pwn(2055) : error 010: invalid function or declaration

U cemu je problem.
PLS HELP!!!

matejdz

Napravi ovako:

if(newstate == PLAYER_STATE_DRIVER)
{
new newcar = GetPlayerVehicleID(playerid);
.
.
.


Pa zatim ovo:

if(newcar == 404 || newcar == 405 || newcar == 406)
{
    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
    {
        if(PlayerInfo[playerid][pRank] < 3)
        {
        SendClientMessage(playerid,COLOR_GREY,"Trebate Rank 3 da biste vozili ovo vozilo !");
        RemovePlayerFromVehicle(playerid);
        }
    }
    else
    {
        SendClientMessage(playerid,COLOR_GREY,"Niste licenser, napustate vozilo !");
        RemovePlayerFromVehicle(playerid);
    }
}

di da stavim ono prvo i jeli trebam sta mjenjat u prvom

matejdz

Pa ako koristis GF imas i to tamo, pronadi....

U funkciji:
public OnPlayerStateChange(playerid, newstate, oldstate)
{

kad napravim sve kako si rekao dobijem ove erore:
C:\DOCUME~1\sarma\Desktop\SAMP02~1.WIN\GAMEMO~1\MSRP.pwn(1836) : error 010: invalid function or declaration
C:\DOCUME~1\sarma\Desktop\SAMP02~1.WIN\GAMEMO~1\MSRP.pwn(1838) : error 010: invalid function or declaration
C:\DOCUME~1\sarma\Desktop\SAMP02~1.WIN\GAMEMO~1\MSRP.pwn(1840) : error 010: invalid function or declaration
C:\DOCUME~1\sarma\Desktop\SAMP02~1.WIN\GAMEMO~1\MSRP.pwn(1846) : error 010: invalid function or declaration

erori su u ovome(rediovi u kojima je eror su u boji):
if(newcar == 404 || newcar == 405 || newcar == 406)
{
    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
    {
        if(PlayerInfo[playerid][pRank] < 3)
        {
        SendClientMessage(playerid,COLOR_GREY,"Trebate Rank 3 da biste vozili ovo vozilo !");
        RemovePlayerFromVehicle(playerid);
        }
    }
    else
    {
        SendClientMessage(playerid,COLOR_GREY,"Niste licenser, napustate vozilo !");
        RemovePlayerFromVehicle(playerid);
    }
}

a na ovima crtama su erori:
1.
if(newcar == 404 || newcar == 405 || newcar == 406)
2.
if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
3.
if(PlayerInfo[playerid][pRank] < 3)
4.
else

matejdz

Kopiraj tu cijelu funkciju,

public OnPlayerStateChange(playerid, newstate, oldstate)
{

to mi je vec bilo u gm pa ja to nisam nista dirao.
Evo ti cijela funkcija:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new string[256];
if(newstate == PLAYER_STATE_ONFOOT)
{
   if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0)
{
   PlayerInKart[playerid] = 0;
   KartingPlayers --;
}
   if(TransportDuty[playerid] > 0)
{
   if(TransportDuty[playerid] == 1)
{
       TaxiDrivers -= 1;
}
else if(TransportDuty[playerid] == 2)
{
   BusDrivers -= 1;
}
TransportDuty[playerid] = 0;
format(string, sizeof(string), "* Otiosao si sa duznosti i zaradio $%d.", TransportMoney[playerid]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, TransportMoney[playerid]);
ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
   if(IsPlayerConnected(TransportDriver[playerid]))
{
   TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
   TransportTime[TransportDriver[playerid]] = 0;
   TransportCost[TransportDriver[playerid]] = 0;
   format(string, sizeof(string), "~w~The ride cost~n~~r~$%d",TransportCost[playerid]);
   GameTextForPlayer(playerid, string, 5000, 1);
   format(string, sizeof(string), "~w~Putnik je napustio taxi~n~~g~Dobio si $%d",TransportCost[playerid]);
   GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
GivePlayerMoney(playerid, -TransportCost[playerid]);
TransportCost[playerid] = 0;
TransportTime[playerid] = 0;
TransportDriver[playerid] = 999;
}
}
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
}
if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
{
   new name[MAX_PLAYER_NAME];
   GetPlayerName(playerid, name, sizeof(name));
   new vehicleid = GetPlayerVehicleID(playerid);
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
       if(IsPlayerConnected(i))
       {
           if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
           {
               if(GetPlayerMoney(playerid) < TransportValue[i])
               {
                   format(string, sizeof(string), "* Trebas $%d da udes.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
RemovePlayerFromVehicle(playerid);
               }
               else
               {
                   if(TransportDuty[i] == 1)
                   {
                       format(string, sizeof(string), "* Platio si $%d Taxi vozacu.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Putnik %s je usao u tvoj Taxi.", name);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
TransportTime[i] = 1;
                    TransportTime[playerid] = 1;
                    TransportCost[playerid] = TransportValue[i];
                    TransportCost[i] = TransportValue[i];
                    TransportDriver[playerid] = i;
                   }
                   else if(TransportDuty[i] == 2)
                   {
                       format(string, sizeof(string), "* Platio si $%d vozacu Busa.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Putnik %s je usao u tvoj Bus.", name);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
                   }
GivePlayerMoney(playerid, - TransportValue[i]);
TransportMoney[i] += TransportValue[i];
               }
           }
       }
   }
}
if(newstate == PLAYER_STATE_WASTED)
{
if(WantedLevel[playerid] >= 1)
{
   new price = WantedLevel[playerid] * 4000;
new count;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
   if(gTeam[i] == 2 && CrimInRange(30.0, playerid,i))
   {
count = 1;
format(string, sizeof(string), "~w~Running Suspect~r~Killed~n~Bonus~g~$%d", price);
GameTextForPlayer(i, string, 5000, 1);
ConsumingMoney[i] = 1;
GivePlayerMoney(i, price / 2);
PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
}
}
}
if(count == 1)
{
GivePlayerMoney(playerid, - price);
PlayerInfo[playerid][pWantedDeaths] += 1;
PlayerInfo[playerid][pJailed] = 1;
   PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid])*(600);
   format(string, sizeof(string), "* U zatvoru si %d Sekunda i izgubio si $%d zbog bjezanja i upucan si od strane policajca.", PlayerInfo[playerid][pJailTime], price);
   SendClientMessage(playerid, COLOR_LIGHTRED, string);
   WantedPoints[playerid] = 0;
WantedLevel[playerid] = 0;
}
}
}
if(newstate == PLAYER_STATE_DRIVER) //buggy dont finnish
{// 38 / 49 / 56 = SS
new newcar = GetPlayerVehicleID(playerid);
new oldcar = gLastCar[playerid];
new housecar = PlayerInfo[playerid][pPhousekey]+1;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
if(IsABoat(newcar))
{
   if(PlayerInfo[playerid][pBoatLic] < 1)
{
   SendClientMessage(playerid, COLOR_GREY, "   Neznas  ploviti, stoga si napustio brod !");
   RemovePlayerFromVehicle(playerid);
}
}
else if(IsAPlane(newcar))
{
   if(PlayerInfo[playerid][pFlyLic] < 1)
{
   if(TakingLesson[playerid] == 1) { }
   else {
   SendClientMessage(playerid, COLOR_GREY, "   Neznas letjeti, stoga si napustio avion !");
   RemovePlayerFromVehicle(playerid); }
}
}
else
{
if(PlayerInfo[playerid][pCarLic] < 1)
{
   if(PlayerDrunk[playerid] >= 5)
{
   WantedPoints[playerid] += 1;
SetPlayerCriminal(playerid,255, "Drunk Driving");
}
if(TakingLesson[playerid] == 1) { }
else {
SendClientMessage(playerid, COLOR_GREY, "   Neznas voziti, stoga si napustio vozilo !");
               RemovePlayerFromVehicle(playerid); }
}
else if(PlayerDrunk[playerid] >= 5)
{
   WantedPoints[playerid] += 1;
SetPlayerCriminal(playerid,255, "Drunk Driving");
}
}//Done with car check
if(IsACopCar(newcar))
{
   if(IsACop(playerid)) { }
   else { RemovePlayerFromVehicle(playerid); }
}
else if(IsAnAmbulance(newcar))
{
   if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4) { }
   else { RemovePlayerFromVehicle(playerid); }
}
if(IsATruck(newcar))
{
format(string, sizeof(string), "Products: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, COLOR_WHITE, "INFO: Mozes dostaviti Produkte Bizzovima.");
SendClientMessage(playerid, COLOR_WHITE, "INFO: Komande su /load /buyprods /sellprods");
}
if(PlayerKarting[playerid] != 0)
{
   new kart = GetPlayerVehicleID(playerid);
   if(kart==110||kart==111||kart==112||kart==113||kart==114||kart==115)
   {
       PlayerInKart[playerid] = 1;
    KartingPlayers ++;
}
}
if(newcar == 0 || newcar == 0)
{
   if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)//national guard
   {
       if(PlayerInfo[playerid][pRank] < 3)
       {
       SendClientMessage(playerid,COLOR_GREY,"   Trebas biti rank 3 da bi vozio ovo vozilo !");
       RemovePlayerFromVehicle(playerid);
       }
   }
   else
   {
       RemovePlayerFromVehicle(playerid);
   }
}
if(newcar == 55)
{
   if(PlayerInfo[playerid][pMember] != 4)
   {
       SendClientMessage(playerid,COLOR_GREY,"   Nisi vatrogasac !");
       RemovePlayerFromVehicle(playerid);
   }
}
if(newcar == 64 || newcar == 65)
{
   if(PlayerInfo[playerid][pJob] != 14)
   {
       SendClientMessage(playerid,COLOR_GREY,"   Nisi vozac Busa !");
       RemovePlayerFromVehicle(playerid);
   }
}
if(newcar == 69 || newcar == 70 || newcar == 71 || newcar == 99 || newcar == 100 || newcar == 101)
{
   if(TakingLesson[playerid] == 1) { }
   else if(!IsAnInstructor(playerid))
   {
       SendClientMessage(playerid,COLOR_GREY,"   Nisi skolski instruktor !");
       RemovePlayerFromVehicle(playerid);
   }
}
if(newcar == 82 || newcar == 84 || newcar == 85 || newcar == 94)
{
   if(PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10) { }
   else
{
       SendClientMessage(playerid,COLOR_GREY,"   Nisi vozac Taxia !");
       RemovePlayerFromVehicle(playerid);
   }
}
if(newcar == 95)
{
   if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
   {
       if(PlayerInfo[playerid][pRank] < 3)
   {
       SendClientMessage(playerid, COLOR_GREY, "   Tvoj rank je premalen !");
   RemovePlayerFromVehicle(playerid);
   }
   }
   else
   {
       SendClientMessage(playerid, COLOR_GREY, "   Nisi Hitman !");
   RemovePlayerFromVehicle(playerid);
   }
}
if(newcar==173||newcar==172||newcar==171||newcar==174||newcar==170||newcar==96||newcar==97||newcar==98||newcar==169)
{

if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3){ }
else
{
   SendClientMessage(playerid, COLOR_GREY, "You are not a News Reporter !");
   RemovePlayerFromVehicle(playerid);
}
if(PlayerInfo[playerid][pNewsSkill] < 200 && newcar == 0)
{
   SendClientMessage(playerid, COLOR_GREY, "   Tvoj News Reporter Skill je premalen, nemozes voziti helihopter !");
   RemovePlayerFromVehicle(playerid);
}
}
if(newcar==110||newcar==111||newcar==112||newcar==113||newcar==114||newcar==115)
{
   if(PlayerKarting[playerid] != 1)
   {
       RemovePlayerFromVehicle(playerid);
   }
}
if(newcar >= 72 && newcar <= 74)
{
if (HireCar[playerid] != newcar)
{
format(string, sizeof(string), "~w~Mozes iznajmiti ovo vozilo~n~Cijena:~g~$%d~n~~w~Da bi ga iznajmio upisi ~g~/rentcar~w~~n~da bi izasao upisi ~r~/exit",SBizzInfo[0][sbEntranceCost]);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, string, 5000, 3);
}
}
if(newcar >= 75 && newcar <= 77)
{
if (HireCar[playerid] != newcar)
{
format(string, sizeof(string), "~w~Mozes iznajmiti ovo vozilo~n~Cijena:~g~$%d~n~~w~Da bi ga iznajmio upisi ~g~/rentcar~w~~n~da bi izasao upisi ~r~/exit",SBizzInfo[1][sbEntranceCost]);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, string, 5000, 3);
}
}
if(oldcar != 301)
{
if((housecar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != housecar))
{
if(gLastDriver[oldcar] == playerid && oldcar != newcar)
{
gLastDriver[oldcar] = 300;
gCarLock[oldcar] = 0;
UnLockCar(oldcar);
}
}
}
gLastCar[playerid] = newcar;
gLastDriver[newcar] = playerid;
}
if(newstate == PLAYER_STATE_SPAWNED)
{
new Float: lwx, Float:lwy, Float:lwz;
GetPlayerPos(playerid, lwx, lwy, lwz);
if((lwz > 530.0 && PlayerInfo[playerid][pInt] == 0) || PlayerToPoint(1000.0, playerid, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
{
SetPlayerSpawn(playerid);
}
if(WantedPoints[playerid] > 0)
{
   new dstring[128];
new wanted = WantedPoints[playerid];
new diecash = 0;
   while(WantedPoints[playerid] > 0)
   {
       diecash += 500;
       WantedPoints[playerid] --;
   }
   format(dstring, sizeof(dstring), "Izgubio si $%d zbog smrti sa %d Wanted Pointom.", diecash, wanted);
   SendClientMessage(playerid, COLOR_YELLOW, dstring);
   GivePlayerMoney(playerid, - diecash);
   PlayerInfo[playerid][pWantedDeaths] += 1;
}
if(PlayerOnMission[playerid] > 0)
{
GameTextForPlayer(playerid, "~r~Misija nije uspjela", 5000, 3);
PlayerOnMission[playerid] = 0;
   PlayerInfo[playerid][pMissionNr] = 0;
}
WantedPoints[playerid] = 0;
WantedLevel[playerid] = 0;
if(PlayerInfo[playerid][pDonateRank] > 0) { SetPlayerHealth(playerid, 100.0); }
else { SetPlayerHealth(playerid, 50.0+PlayerInfo[playerid][pSHealth]); }
MedicBill[playerid] = 1;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
gPlayerSpawned[playerid] = 1;
SafeTime[playerid] = 60;
}
return 1;
}

to je cijela funkcija a ovo je ono sta si ti reko da treba stavit(to je vec bilo tamo pa ja nisam nista dirao):
if(newstate == PLAYER_STATE_DRIVER) //buggy dont finnish
{// 38 / 49 / 56 = SS
new newcar = GetPlayerVehicleID(playerid);
new oldcar = gLastCar[playerid];
new housecar = PlayerInfo[playerid][pPhousekey]+1;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;


EDIT:Puno ti hvala matej uspio sam ide lokot
Poslednja Izmena: Avgust 20, 2009, 09:41:30 PRE PODNE od sorfa