SA:MP zajednica Zapadni Balkan

Čet - 12.12.2019. - 05:25
Aktiviraj Nyx stil Aktiviraj Elastica stil

Novi Postovi

 Str: 1 [2] 3 4 ... 10
11
tek sam sada primijetio da pored greske u uslovu da nisi pravilno brackete otvarao i zatvarao, evo ti kod, nisam provjerio ali po citanju je to to

Pawn: [Odaberi]
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
new vehid = GetPlayerVehicleID (playerid);
if (vehid == vipvehicle1 || vehid == vipvehicle2 || vehid == vipvehicle3 || vehid == vipvehicle4 || vehid == vipvehicle5 || vehid == vipvehicle6 || vehid == vipvehicle7 || vehid == vipvehicle8 || vehid == vipvehicle9 || vehid == vipvehicle10 || vehid == vipvehicle11 || vehid == vipvehicle12 || vehid == vipvehicle13 || vehid == vipvehicle14 || vehid == vipvehicle15 || vehid == vipvehicle16 || vehid == vipvehicle17 || vehid == vipvehicle18 || vehid == vipvehicle19 || vehid == vipvehicle20)
{
if(PlayerInfo[playerid][pVip] == 0)
{
RemovePlayerFromVehicle(playerid);
SCM(playerid, COLOR_RED, "[SERVER]: {FFFFFF}Ne možeš da voziš VIP vozilo, jer nemaš VIP rank!");
}
}
}
return 1;
}

a evo i nacina na koji ja radim, laksi je malo kroz array poredati vozila

Pawn: [Odaberi]
new VipVozila[2];

public OnGameModeInit()
{
VipVozilo[0] = AddStaticVehicle(522, 0, 0, 0, 0, -1, -1);
VipVozilo[1] = AddStaticVehicle(522, 7, 0, 0, 0, -1, -1);
for(new i = 0; i < sizeof(VipVozila); i++)
{
    Attach3DTextLabelToVehicle(Create3DTextLabel("VIP", 0xFFFFFFFF, 0.0, 0.0, 0.0, 15.0, 0, 0), VipVozila[i], 0.0, 0.0, 0.0);
}
return (true);
}

VozilaVip(carid)
{
for(new i = 0; i < sizeof(VipVozila); i++)
{
if(carid == VipVozila[i]) return (true);
}
return (false);
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
    if(VozilaVip(vehid))
{
if(PlayerInfo[playerid][pVip] == 0)
{
SendClientMessage(playerid, -1, "Samo VIP");
RemovePlayerFromVehicle(playerid);
}
}

    }
  return (true);
}
12
Tražim skriptu, trebam skriptera, nudim ... / Trazim × SKRIPTERA ×
« Zadnji post Shaolin012 Uto - 10.12.2019. - 11:23  »
Što tražite/nudite: Trazim iskusnijeg i starijeg skriptera
Nagrada: Sve informacije u pm ili fb  , hitno
Kontakt: FB: https://m.facebook.com/shomy.zg.37?ref=bookmarks
Ili PM
                           ❌ HITNO ❌
13
Server skripte za igranje / Odg: Meanwhile PRPG
« Zadnji post sandzooo Pon - 09.12.2019. - 22:56  »
Svaka čast na skripti. Sve pohvale
14
Pawn: [Odaberi]
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
new vehid = GetPlayerVehicleID (playerid);
if (vehid == vipvehicle1 || vehid == vipvehicle2 || vehid == vipvehicle3 || vehid == vipvehicle4 || vehid == vipvehicle5 || vehid == vipvehicle6 || vehid == vipvehicle7 || vehid == vipvehicle8 || vehid == vipvehicle9 || vehid == vipvehicle10 || vehid == vipvehicle11 || vehid == vipvehicle12 || vehid == vipvehicle13 || vehid == vipvehicle14 || vehid == vipvehicle15 || vehid == vipvehicle16 || vehid == vipvehicle17 || vehid == vipvehicle18 || vehid == vipvehicle19 || vehid == vipvehicle20)
(
if(PlayerInfo[playerid][pVip] = 0)
(
    RemovePlayerFromVehicle(playerid);
    SCM(playerid, COLOR_RED, "[SERVER]: {FFFFFF}Ne možeš da voziš VIP vozilo, jer nemaš VIP rank!");
)
)
)
return 1;
}
15
Ima zagrada, evo ti ispod kao code.
17
Pawn: [Odaberi]
if(PlayerInfo[playerid][pVip] == 0)
a na liniji 298 pogledaj da li imas zatvorenu zagradu ) posto je ne vidim
sledeci put prijatelju ostavi kod a ne sliku, jer je mnogo lakse kad se u pawnu gleda kod nego kao slika :)
18




Bilo je još nekoliko errora, ali sam ih nekako uklonio. Hvala svakom ko barem pogleda ovaj post.
19
Sa otvaranja, 99 igrača (ne stigoh da slikam...) i pade nam server zbog nekih problemčića sa skriptom, ...- međutim sve je to rešeno ubrzo i posle smo gurali 70-95 igrača tokom dana.  Mi smo prezadovoljni, posetite nas i pridružite nam se! Da se družimo svi zajedno i uživamo :)

20
Pawn: [Odaberi]
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, true);

Pawn: [Odaberi]
TogglePlayerSpectating(playerid, false);
TogglePlayerSpectating(playerid, true);

Pokusaj sa jednim od gore navedenih primjera, nikako ih nemoj oba dodavati
Dodajes ih u callback OnplayerRequestClass
 Str: 1 [2] 3 4 ... 10
© 2011 - 2019, SA:MP zajednica Zapadni Balkan. All rights reserved.