Need Help Rent System - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need Help Rent System (
/showthread.php?tid=442664)
Need Help Rent System -
imnoob - 08.06.2013
ERROR
Код:
C:\Documents and Settings\Корисник\Desktop\FreakWorld RPG Macedonia\filterscripts\RentBike.pwn(40) : error 017: undefined symbol "RentBike"
C:\Documents and Settings\Корисник\Desktop\FreakWorld RPG Macedonia\filterscripts\RentBike.pwn(40) : warning 215: expression has no effect
C:\Documents and Settings\Корисник\Desktop\FreakWorld RPG Macedonia\filterscripts\RentBike.pwn(40) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Корисник\Desktop\FreakWorld RPG Macedonia\filterscripts\RentBike.pwn(40) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Корисник\Desktop\FreakWorld RPG Macedonia\filterscripts\RentBike.pwn(40) : fatal error 107: too many error messages on one line
LINE 40
Код:
RentBike[1] = AddStaticVehicleEx(462,1671.5101,-1892.7987,13.1449,89.0272,0,0,3600); // 187
here is all i done
Код:
//---------------//
forward RentBike(carid)
//--------------//
new Rentano[MAX_PLAYERS];
new RentBike[25];
//-------------//
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
CMD:rentaj(playerid,params[])
{
new string[128];
if (GetPlayerMoney(playerid) < 150)//Ako igrac nema 150 $, nece moci da renta.
{
SendClientMessage(playerid, COLOR_GRAD2, "Nemas dovoljno Novca!");
return 1;
}
if(Rentano[playerid] != 299)//Proverava da li vec imas rentano vozilo.
{
SendClientMessage(playerid, SIVA, "Moras prvo da vratis iznajmljeno vozilo.");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(Rentano<i> == GetPlayerVehicleID(playerid))//Ako je neko rentao vozilo, neces ga moci rentati
{
SendClientMessage(playerid, SIVA, "Neko je vec rentao ovo vozilo.");
return 1;
}
GivePlayerMoney(playerid,-150);//Oduzima igracu 150$
Rentano[playerid] = GetPlayerVehicleID(playerid);//Postavlja igracu rent vozilo(da drugi nmg rentati)
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);// Pusta neke zvuke...
format(string, sizeof(string), "~r~/unrentcar~n~~g~/lock.");//Tekst koji ce biti u GameTextu
SendClientMessage(playerid, ZUTA, "Prijatan dan!");// ispisuje poruku igracu
TogglePlayerControllable(playerid, 1);//Odmrzava igraca - Omogucava mu da se krece
GameTextForPlayer(playerid, string, 5000, 3);// Prikazuje GameText
return 1;
}
}
CMD:unrentaj(playerid,params[])
{
new idcar = GetPlayerVehicleID(playerid);
if(Rentano[playerid] != 299)
{
if(idcar == Rentano[playerid])
{
TogglePlayerControllable(playerid, 1);
}
SetVehicleToRespawn(Rentano[playerid]);
Rentano[playerid] = 299;
SendClientMessage(playerid,CRVENA,"Vratio si iznajmljeno vozilo!");
}
return 1;
}
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
if(RentVozila(newcar))
{
if (Rentano[playerid] != newcar)
{
SendClientMessage(playerid,ZELENA,"========== RENT VOZILO ==========");
SendClientMessage(playerid,LJUBICASTA,"Da rentas: /rentcar .");
SendClientMessage(playerid,LJUBICASTA,"Da izadjes: /exitcar .");
TogglePlayerControllable(playerid, 0);// Freeza igraca, da ne moze da pobegne
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
else
{
return 1;
}
}
}
return 1;
}
Код:
public RentBike(carid)
{
for(new i = 0; i < sizeof(Rent); i++)
{
if(carid == Rent<i>) return 1;
}
return 0;
}</i>
WHAT's WRONG ? HELP ME
Re: Need Help Rent System -
imnoob - 08.06.2013
refresh
Re: Need Help Rent System -
Chris10 - 08.06.2013
Hmm try changing this:
forward RentBike(carid)
to
forward RentBike(carid);
Re: Need Help Rent System -
imnoob - 08.06.2013
same errors