[POMOC]isplayradmin

Započeo Arnel_Bp, Avgust 28, 2013, 21:05:44 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim: moja od 0
Detaljan opis problema: pa u bazu koju sam namestio imaju auta i kako to da namestim ako je igrac /rcon admin da moze samo da vozi a ako nije da ga izbaci iz auta odma ? moze pomoc hitno je ;) ?
Dio skripte: //
Neke slike/video za lakse dobivanje pomoci(neobavezno): //

if(!IsPlayerAdmin(playerid))
{
//kodovi za izbacivanje igraca iz vozila
}
Other Dimension RolePlay | Uskoro
Ukoliko zelite pomoci u razvoju servera, mozete se meni javit na PP/PM!

Citat: Crazyn3ss poslato Avgust 28, 2013, 21:08:28 POSLE PODNE
if(!IsPlayerAdmin(playerid))
{
//kodovi za izbacivanje igraca iz vozila
}


gde ovo da stavim na gamemode init ? ili entervehicle ?

Pronadji public OnPlayerStateChange i pod if(newstate == PLAYER_STATE_DRIVER) dodaj if(Tvojavarijablazavozila(newcar))
{
    IsPlayerAdmin(playerid) { }
    else {
        SafeRemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");}
}
i to bi bilo to

Citat: Arnel_Bp poslato Avgust 28, 2013, 21:10:18 POSLE PODNE
Citat: Crazyn3ss poslato Avgust 28, 2013, 21:08:28 POSLE PODNE
if(!IsPlayerAdmin(playerid))
{
//kodovi za izbacivanje igraca iz vozila
}


gde ovo da stavim na gamemode init ? ili entervehicle ?

moras napraviti i provjeru ako ulazi u to vozilo koje je u bazi, a to stavljas u onplayerstatechange ili onplayerentervehicle
Other Dimension RolePlay | Uskoro
Ukoliko zelite pomoci u razvoju servera, mozete se meni javit na PP/PM!

Citat: [BS]SimkE poslato Avgust 28, 2013, 21:11:09 POSLE PODNE
Pronadji public OnPlayerStateChange i pod if(newstate == PLAYER_STATE_DRIVER) dodaj if(Tvojavarijablazavozila(newcar))
{
    IsPlayerAdmin(playerid) { }
    else {
        SafeRemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");}
}
i to bi bilo to

ja ovo ne shvatam jel mzoes od ovih coordinata napraviti jedan primer molim te ?

CreateVehicle(446, 2632.3315, -2478.7324, 2.1833, 90.0000, 0,0, 100);
CreateVehicle(446, 2616.6145, -2478.6050, 2.1833, 90.0000, 0,0, 100);
CreateVehicle(446, 2601.3899, -2478.6877, 2.1833, 90.0000, 0,0, 100);
CreateVehicle(487, 2549.3604, -2439.7581, 132.2062, -45.0000, 0,0, 100);
CreateVehicle(560, 2610.9915, -2454.8401, 13.3373, 0.0000, 0,0, 100);
CreateVehicle(560, 2606.7961, -2454.6885, 13.3373, 0.0000, 0,0, 100);
CreateVehicle(560, 2602.1763, -2454.5845, 13.3373, 0.0000, 0,0, 100);
CreateVehicle(560, 2597.6978, -2454.3867, 13.3373, 0.0000, 0,0, 100);
CreateVehicle(560, 2592.6960, -2454.2598, 13.3373, 0.0000, 0,0, 100);
CreateVehicle(580, 2583.1917, -2453.9443, 13.3373, 0.0000, 0,0, 100);
CreateVehicle(580, 2577.5105, -2453.8206, 13.3373, 0.0000, 0,0, 100);
CreateVehicle(506, 2571.8943, -2453.4575, 13.3373, 0.0000, 0,0, 100);
CreateVehicle(506, 2566.0273, -2453.4819, 13.3373, 0.0000, 0,0, 100);
CreateVehicle(522, 2557.0579, -2420.3396, 13.3373, 54.0000, 0,0, 100);
CreateVehicle(522, 2555.7903, -2422.1414, 13.3373, 54.0000, 0,0, 100);
CreateVehicle(522, 2554.6191, -2423.5156, 13.3373, 54.0000, 0,0, 100);
CreateVehicle(522, 2553.1548, -2425.1223, 13.3373, 54.0000, 0,0, 100);
CreateVehicle(522, 2552.0305, -2426.7039, 13.3373, 54.0000, 0,0, 100);
CreateVehicle(522, 2550.7166, -2428.6233, 13.3373, 54.0000, 0,0, 100);

Dodaj na pocetku skripte new AdminVozila[19];

Zatim dodaj na kraju skripte forward Adminvozila(carid)
public Adminvozila(carid)
{
for(new i = 0; i < sizeof(AdminVozila); i++)
{
if(carid == AdminVozila[i]) return 1;
}
return 0;
}


I onda pod OnGameModeInit dodaj vozila AdminVozila[0] =AddStaticVehicleEx(446, 2632.3315, -2478.7324, 2.1833, 90.0000, 0,0, 100);
AdminVozila[1] =AddStaticVehicleEx(446, 2616.6145, -2478.6050, 2.1833, 90.0000, 0,0, 100);
AdminVozila[2] =AddStaticVehicleEx(446, 2601.3899, -2478.6877, 2.1833, 90.0000, 0,0, 100);
AdminVozila[3] =AddStaticVehicleEx(487, 2549.3604, -2439.7581, 132.2062, -45.0000, 0,0, 100);
AdminVozila[4] =AddStaticVehicleEx(560, 2610.9915, -2454.8401, 13.3373, 0.0000, 0,0, 100);
AdminVozila[5] =AddStaticVehicleEx(560, 2606.7961, -2454.6885, 13.3373, 0.0000, 0,0, 100);
AdminVozila[6] =AddStaticVehicleEx(560, 2602.1763, -2454.5845, 13.3373, 0.0000, 0,0, 100);
AdminVozila[7] =AddStaticVehicleEx(560, 2597.6978, -2454.3867, 13.3373, 0.0000, 0,0, 100);
AdminVozila[8] =AddStaticVehicleEx(560, 2592.6960, -2454.2598, 13.3373, 0.0000, 0,0, 100);
AdminVozila[9] =AddStaticVehicleEx(580, 2583.1917, -2453.9443, 13.3373, 0.0000, 0,0, 100);
AdminVozila[10] =AddStaticVehicleEx(580, 2577.5105, -2453.8206, 13.3373, 0.0000, 0,0, 100);
AdminVozila[11] =AddStaticVehicleEx(506, 2571.8943, -2453.4575, 13.3373, 0.0000, 0,0, 100);
AdminVozila[12] =AddStaticVehicleEx(506, 2566.0273, -2453.4819, 13.3373, 0.0000, 0,0, 100);
AdminVozila[13] =AddStaticVehicleEx(522, 2557.0579, -2420.3396, 13.3373, 54.0000, 0,0, 100);
AdminVozila[14] =AddStaticVehicleEx(522, 2555.7903, -2422.1414, 13.3373, 54.0000, 0,0, 100);
AdminVozila[15] =AddStaticVehicleEx(522, 2554.6191, -2423.5156, 13.3373, 54.0000, 0,0, 100);
AdminVozila[16] =AddStaticVehicleEx(522, 2553.1548, -2425.1223, 13.3373, 54.0000, 0,0, 100);
AdminVozila[17] =AddStaticVehicleEx(522, 2552.0305, -2426.7039, 13.3373, 54.0000, 0,0, 100);
AdminVozila[18] =AddStaticVehicleEx(522, 2550.7166, -2428.6233, 13.3373, 54.0000, 0,0, 100);


I onda pod OnPlayerStateChange kao sto sam ti vec objasnio dodas if(Adminvozila(newcar))
{
    IsPlayerAdmin(playerid) { }
    else {
        SafeRemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");}
}

C:\Users\Arnel\Downloads\Desktop\srw1\filterscripts\base.pwn(376) : error 017: undefined symbol "newcar"
C:\Users\Arnel\Downloads\Desktop\srw1\filterscripts\base.pwn(378) : error 001: expected token: ";", but found "{"
C:\Users\Arnel\Downloads\Desktop\srw1\filterscripts\base.pwn(379) : error 029: invalid expression, assumed zero
C:\Users\Arnel\Downloads\Desktop\srw1\filterscripts\base.pwn(380) : error 017: undefined symbol "SafeRemovePlayerFromVehicle"
C:\Users\Arnel\Downloads\Desktop\srw1\filterscripts\base.pwn(381) : error 017: undefined symbol "COLOR_GREY"
C:\Users\Arnel\Downloads\Desktop\srw1\filterscripts\base.pwn(504) : error 001: expected token: ";", but found "public"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.


sta sa ovim da radim jedino sta znam ovaj eror na 381 liniji da fix ovo drugo ne
Poslednja Izmena: Avgust 28, 2013, 22:31:33 POSLE PODNE od Arnel_Bp

Evo dodaj ovo new newcar = GetPlayerVehicleID(playerid); pod if(newstate == PLAYER_STATE_DRIVER) da popravis error 376, a za error 380 dodaj ovo na kraju skripte forward SafeRemovePlayerFromVehicle(playerid);
public SafeRemovePlayerFromVehicle(playerid)
{
RemovePlayerFromVehicle(playerid);
return 1;
}