Kubko
-
Příspěvků
257 -
Registrován
-
Aktivní
-
Vítězných dnů
3
Content Type
Profiles
Forums
Calendar
Gallery
SA-MP
Příspěvky posted by Kubko
-
-
new auta[5]; //5 je počet áut, ak chceš viac tak to zväčši
//Potom niekde vozidla vytvor
auta[0] = CreateVehicle(...);
auta[1] = CreateVehicle(...);
//Potom, keď sa hráč napojí do arény
new
i;
for(new j; j != MAX_PLAYERS; j++)
{
if(GetPlayerVehicleID(j) == auta[i])
{
i++;
}
}
PutPlayerInVehicle(playerid, auta[i], 0); -
Potom môžeš hocikde v móde skontrolovať, či je hráč dozorca, alebo väzeň cez JeHracDozorca(playerid), alebo JeHracVezen(playerid). Je to len preto, aby si nemusel všade písať celú podmienku.
#define JeHracDozorca(%0) if(GetPlayerSkin(%0) == 286) #define JeHracVezen(%0) if(GetPlayerSkin(%0) == 292) public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/go1", cmdtext, true)) { if(JeHracDozorca(playerid)) { //Je dozorca } else { SendClientMessage(playerid, -1, "Tento príkaz môže použiť iba dozorca!"); } return 1; } return 0; }
-
dcmd_setlvl(playerid,parmas[])
To nie sú parmas, ale params, ale myslím si, že to v skutočnosti nevadí, je to len názov argumentu.
-
SetPlayerScore asi.
-
Ten return, keď chceš ukončiť dialóg nemá veľmi efekt, môžeš tam dať aj return;.
-
Windows určite.
-
Ak chceš niekomu pomôcť, tak píš čo najjednoduchší kód .
A čo na tom nie je jednoduché?
-
new
const skin[] =
{
20, 30, 60
};
SetPlayerSkin(playerid, skin[random(sizeof(skin)])); -
A ide ti aspoň /ban?
-
Aha, tak:
public OnPlayerDisconnect(playerid, reason) { SaveDis(playerid); return 1; }
-
public OnPlayerConnect(playerid)
{
new
string[40];
GetPlayerName(playerid, string, sizeof (string));
format(string, sizeof (string), "/Accounts/%s.txt", string);
if (!fexist(string))
{
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_MSGBOX, "Vitej","Vítej hráči, poprvé tě vidíme na našem serveru asi říkaš, co je to za server. \nJe to RolePlay kde lidi si hrají Reálný Život a Zaměstnávaj se. Najdeš tu okrem toho plno zábavy, zabíjení \na jiné blbosti...","OK","");
}
else
{
ShowPlayerDialog(playerid, 21, DIALOG_STYLE_INPUT, "Login", "Prihlás sa:", "Potrvdiť", "Zrušiť");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case 20:
{
Register(playerid, inputtext);
return 1;
}
case 21:
{
Login(playerid, inputtext);
return 1;
}
}
return 0;
}
stock Register(playerid, key[])
{
new Udaje[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Udaje,sizeof(Udaje),"/Accounts/%s.txt",name);
dini_Create(Udaje);
dini_Set(Udaje,"Heslo",key);
dini_IntSet(Udaje, "Money", GetPlayerMoney(playerid));
dini_IntSet(Udaje, "Skore", GetPlayerScore(playerid));
dini_IntSet(Udaje, "Skin", GetPlayerSkin(playerid));
dini_BoolSet(Udaje, "Vodicak", vodicak[playerid]);
dini_BoolSet(Udaje, "Zamestnani", zamestnani[playerid]);
SendClientMessage(playerid,0x14EB00AA,"[ RolePlay ] Uspěšně zaregistrovaný!");
SetPlayerMoney(playerid, 2000);
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_MSGBOX, "Vitej","Vítej hráči, poprvé tě vidíme na našem serveru asi říkaš, co je to za server. \nJe to RolePlay kde lidi si hrají Reálný Život a Zaměstnávaj se. Najdeš tu okrem toho plno zábavy, zabíjení \na jiné blbosti...","OK","");
vodicak[playerid] = 0;
zamestnani[playerid] = 0;
}
stock Login(playerid, key[])
{
new Udaje[64];
new name1[MAX_PLAYER_NAME];
GetPlayerName(playerid,name1,sizeof(name1));
format(Udaje,sizeof(Udaje),"/Accounts/%s.txt",name1);
if(!strcmp(key,dini_Get(Udaje,"Heslo"),false))
{
SendClientMessage(playerid,0x14EB00AA,"[ RolePlay ] Uspěšně přihlášen!");
SetPlayerMoney(playerid,dini_Int(Udaje,"Money"));
SetPlayerScore(playerid,dini_Int(Udaje,"Skore"));
SetPlayerSkin(playerid,dini_Int(Udaje,"Skin"));
vodicak[playerid] = dini_Bool(Udaje, "Vodicak");
zamestnani[playerid] = dini_Bool(Udaje, "Zamestnani");
ShowPlayerDialog(playerid,19,DIALOG_STYLE_MSGBOX,"Vitej","Vitej zpátky hráči!","OK","");
}
else
{
SendClientMessage(playerid,0x14EB00AA,"[ RolePlay ] Špatně zadané heslo!");
ShowPlayerDialog(playerid, 21, DIALOG_STYLE_INPUT, "Login","Tvoje heslo již existuje, prosím napíš heslo znovu jak pri registraci!","Login","Konec");
}
return 1;
} -
Znova error.
SetPlayerPos(playerid,1776.2507,1696.4857,13.4731,88);
-
Riadok CMD[ban] prepíš na CMD[banan].
-
WTF ? Ti tam máš CMD[ban] ? Oprav si to na CMD:ban možno to tak je aspoň si to tak myslím.
-
Je to funkcia v include "dudb", ale neviem načo to je, nikdy som to nepoužil. Preto ti to píše warning, lebo si ju nikde v móde nepoužil.
-
#define AUTA_MAX_POCET (3)
enum E_AUTA
{
E_AUTA_MODELY[3]
}
new
gAuta[MAX_PLAYERS][E_AUTA];
//Do príkazu pre spawnutie vozidla
new
i;
for (i = 0; i <= AUTA_MAX_POCET; i++)
{
if (!gAuta[playerid][E_AUTA_MODELY][i])
{
break;
}
}
if (i >= 3) return SendClientMessage(playerid, -1, "Už máš spawnuté 3 vozidlá!");
//Tu si daj spawner kód
//Tu si vytvorené vozidlo zo spawnera zapíš do premenej ako vehicleid
gAuta[playerid][E_AUTA_MODELY][i] = //Tu si pridaj vehicleid
//Do mazania vozidla
for (new i; i < 3; i++)
{
if (gAuta[playerid][E_AUTA_MODELY][i] != 0)
{
DestroyVehicle(gAuta[playerid][E_AUTA_MODELY][i]);
}
} -
Máš kód na to zmazanie?
-
new
AutaPocet[MAX_PLAYERS];
//Do príkazu pre spawnutie vozidla
if (AutaPocet[playerid] <= 3)
{
AutaPocet[playerid]++;
//Ostatný kód
}
else
{
return SendClientMessage(playerid, -1, "Už máš spawnuté 3 vozidlá!");
} -
Možno nie, ale fungovať to nebude.
-
Babecka však je to blbosť uplná.
-
GetPlayerID(const meno[]) { new meno2[MAX_PLAYER_NAME]; for (new i; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { GetPlayerName(i, meno2, sizeof (meno2)); if (!strcmp(meno, meno2, true, strlen(meno) + 1)) { return i; } } } return -1; }
Ak som teda správne pochopil, čo chceš. Potom si daj GetPlayerID("Nick"), ak hráč nie je pripojený tak to vráti -1.
-
Za playerid má byť farba textu.
-
Tak lebo musíš ho deklarovať s poľom pre hráčov, ináč sa to bude správať ako globálny a zblbne to.
-
new Text:textdraw[MAX_PLAYERS];
TextDrawHideForPlayer(playerid, textdraw[playerid]);
Text
v Herní (SA:MP, CS apod.)
Odesláno: