12.03.2015, 19:13
Hey.
I have new problem. So i made a dialog for command /rent and i get this error at this lines:
Errors:
Dialog error:
All OnDialogResponse:
Thank you!
I have new problem. So i made a dialog for command /rent and i get this error at this lines:
Errors:
PHP код:
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1104) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1104 -- 1105) : error 029: invalid expression, assumed zero
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1201) : warning 209: function "S@@_OnDialogResponse" should return a value
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1202) : error 010: invalid function or declaration
PHP код:
if(dialogid == DIALOG_PRAVILA)
{
if(response)
{
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Procitali ste osnovna RP pravila.");
}
}
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"Registracija",""COL_WHITE"Poљtovani,upisali ste nedozvoljivu lozinku.\n"COL_WHITE"Upiљite vasu lozinku kako biste se registrirali na server.\nVazno je znati da"COL_LIGHTBLUE" WG zajednica"COL_WHITE" nece nikad odat vasu lozinku.\nAko imate dodatnih problema kontaktirajte nas na webu!","Registracija","Izlaz");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Skin",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Novac",0);
INI_WriteInt(File,"Supporter",0);
INI_WriteInt(File,"Administrator",0);
INI_WriteInt(File,"Viplevel",0);
INI_WriteInt(File,"Banka",0);
INI_WriteInt(File,"Banovan",0);
INI_WriteInt(File,"Ubojstva",0);
INI_WriteInt(File,"Smrti",0);
INI_Close(File);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Uspjesna registracija",""COL_WHITE"Poљtovani,uspjeљno ste registrirali novi account.\nZa vaљu sigurnost preporucavamo vam da odradite 'relog' kako bismo spremili podatke.\nUzivajte igrajuci na nasem serveru!","Uredu","");
}
}
case DIALOG_LOGIN:
{
if(!response) return Kick(playerid);
if(response)
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Uspjesno logiranje",""COL_WHITE"Poљtovani,uspjeљno ste se ulogirali na vas account.\nNastavite sa igrom tamo gdje ste stali.\nUzivanje na nasem serveru zeli vam"COL_LIGHTBLUE" WG Administracija.\n\n"COL_WHITE"Ako imate dodatnih problema u vezi accounta kontaktirajte nas na webu!\n"COL_ORANGE" www.WilderGaming.net","Uredu","");
SpawnPlayer(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Logiranje",""COL_WHITE"Poљtovani,upisali ste pogreљnu lozinku.\n"COL_WHITE"Molimo vas da pazljivo unesete tocnu lozinku.\nImate"COL_LIGHTBLUE" 30 sekundi"COL_WHITE" da unesete lozinku uprotivnom cete biti kikovani sa servera.","Login","Izlaz");
}
}
}
if(dialogid == DIALOG_PRAVILA)
{
if(response)
{
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Procitali ste osnovna RP pravila.");
}
}
if(dialogid == DIALOG_RADIO)
{
if(!response)
{
SendClientMessage(playerid,-1,"");
}
switch(listitem)
{
case 0:
{
PlayAudioStreamForPlayer(playerid,"http://87.230.53.43:8000/");
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Da zaustavite radio ukucajte{FFF1AF} /stopradio");
}
case 1:
{
PlayAudioStreamForPlayer(playerid,"http://streaming4.tdiradio.com/");
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Da zaustavite radio ukucajte{FFF1AF} /stopradio");
}
case 2:
{
PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=1397078/");
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Da zaustavite radio ukucajte{FFF1AF} /stopradio");
}
case 3:
{
PlayAudioStreamForPlayer(playerid,"http://109.206.96.12:8000/");
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Da zaustavite radio ukucajte{FFF1AF} /stopradio");
}
case 4:
{
PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=111730/");
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Da zaustavite radio ukucajte{FFF1AF} /stopradio");
}
case 5:
{
PlayAudioStreamForPlayer(playerid,"http://yp.shoutcast.com/sbin/tunein-station.pls?id=169102/");
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Da zaustavite radio ukucajte{FFF1AF} /stopradio");
}
}
}
if(dialogid == DIALOG_GPS)
{
if(!response)
{
return SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Zatvorili ste GPS Menu");
}
switch(listitem)
{
case 0:
{
SetPlayerCheckpoint(playerid,-2516.4072,2339.0176,4.9844, 3.0);
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Odabrali ste lokaciju:{FFF1AF} Bolnica");
}
case 1:
{
SetPlayerCheckpoint(playerid,-2535.8347,2286.7209,4.9844, 3.0);
SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Odabrali ste lokaciju:{FFF1AF} Policijska postaja");
}
}
}
if(dialogid == DIALOG_RENT)
{
if(!response)
{
return SendClientMessage(playerid,-1,"{00C0FF}WG:{FFFFFF} Prekinuli ste iznajmljivanje vozila");
}
if(response)
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid,-1,"{F81414}Greska:{FFFFFF} Nemate dovoljno novca na racunu");
if(INVozilo[playerid] == 1) return SendClientMessage(playerid,-1,"{F81414}Greska:{FFFFFF} Ne nalazite se u vozilu za izajmljivanje");
{
INRent[playerid] = 1;
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-500);
ShowPlayerDialog(playerid,DIALOG_RENT_USPJESNO,DIALOG_STYLE_MSGBOX,"Rentanje vozila","{FFFFFF}Rentali ste vozilo na{FFF1AF} 15 minuta.\n{FFFFFF}Ukoliko izadete iz servera automatski se ponistava.\n\n{00C0FF}Hint:\n{FFFFFF}Ako ne koristite rentano vozilo{FFF1AF} (/unrent)","Uredu","");
}
}
}
if(dialogid == DIALOG_KOMANDE)
{
if(response)
{
SendClientMessage(playerid,-1,"");
}
}
}
return true;
}