U ovom topiku možete staviti vaše korisne komande.
Pobrisao sam sve postove u ovoj temi, jer 99% njih su bili za Godfather skriptu, a onaj 1% su bile komande koje se nisu vrijedne nazivati "korisnim".
Od sad naprijed kad budete postali korisne komande u ovu temu, onda gledajte da komanda stvarno bude korisna, a ne komanda kao iz Godfather skripte do koje može svako doći i izvaditi tu komandu sa malo znanja.
ZnaÄi da Godfather komande nisu korisne, jedino ako ste napravili svoju komandu za Godfather/Godfather edit i da je stvarno korisna za tu skriptu, ali onda morate napisati da je ta komanda SAMO za tu skriptu.
Ako komanda izgleda ovako (PRIMJER):
/* zcmd. */
command(mojakomanda, playerid, params[])
{
#pragma unused playerid
new
mojVarijabl[2];
mojVarijabl[0] = strval(params);
mojVarijabl[1] = izracunajFunkcija(mojVarijabl[0]);
return mojVarijabl[1];
}
ZnaÄi u ovoj komandi nepoznata je command() (zcmd procesor) funkcija i izracunajFunkcija (naÅ¡a funkcija) i to morate navesti, jer za poÄetnika ta komanda niÅ¡ta ne znaÄi ako ne zna koje su to funkcije i gdje ih treba tražiti.
Morate staviti link do funkcije ako nije vaša, ali ako je vaša, onda je stavite u post:
/* moja funkcija. */
stock izracunajFunkcija(vrijednost)
{
new
ukupno;
ukupno = ((vrijednost + 5) * 10);
return ukupno;
}
Link do zcmd procesora - http://zeex.pastebin.ca/1650602 (http://zeex.pastebin.ca/1650602)
Korištenje:
Stavite zcmd.inc fajl u vaÅ¡u mapu \pawno\include\ i ubacite ovo na poÄetak vaÅ¡e skripte (najbolje je odma iza #include <a_samp>):
#include <zcmd>
Tako nekako bi to trebalo izgledati.
Pozdrav,
Correlli
Evo jedna moja komanda za busenje guma na autu, znaci sve sta trebate je biti RCON administrator ili jednostavno maknuti iz skripte "if(IsPlayerAdmin(playerid))" Jako jednostavna komanda a opet mozete malo zezati igrace s njom, /busi [ID]
Napravio sam je u DCMD-u evo define od DCMD-a
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Evo komande
dcmd_busi (playerid,params[])
{
new id;
if(strlen(params))
{
id = strval(params);
if(IsPlayerConnected(id))
{
if(IsPlayerInAnyVehicle(id))
{
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(id);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 15);
}
else
{
SendClientMessage(playerid, 0x00FF00AA, "Igrac nije u vozilu.");
}
}
else
{
SendClientMessage(playerid, 0x00FF00AA, "Igrac nije online.");
}
}
else
{
SendClientMessage(playerid, 0x00FF00AA, "/izbusi [ID]");
}
return 1;
}
Ovo morate staviti ispod OnPlayerCommand
dcmd(busi,4,cmdtext);
Evo da se izljecite tu imate komandu /bolnicar koju ja koristim za svoj TDM server :)
Kako bi ste se izljecili treba vam 300$
Komandu moze iskoristiti svako ko ima 300$ te ce mu se SET [ ne GIVE ] health na 100!
if(strcmp(cmdtext, "/bolnicar", true) == 0)//Rocket Buy
{
if (GetPlayerMoney(playerid) >= 300)
{
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -300);
SendClientMessage(playerid,COLOR_GREEN,"Bonicar vas je izljecio za 300$");
PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Nemate dovoljno novca! [Ljecenje = 300$]");
}
return 1;
}
A ovdje imate komandu za samoubistvo :
if(strcmp(cmdtext,"/ubijse",true)==0)//Parachute
{
SendClientMessage(playerid, COLOR_GREEN,"Ubili ste se");
SetPlayerHealth(playerid, 0);
return 1;
}
Jao gluposti od komande onda si bar mogo napraviti /bolnicar [ID] a ne ovo -.-"
COMMAND:bolnicar(playerid,params[])
{
new
id;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, BOJA, "Koristi: /bolnicar [ID]");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, BOJA, "ERROR: Igrac nije online.");
else
{
SetPlayerHealth(id,100);
}
return true;
}
Bilo mi je dosadno dok nisam imao net pa sam napravio jednostavne komande ... :
dcmd(ubij,4,cmdtext);
dcmd(givehealth,4,cmdtext);
dcmd(setint0,4,cmdtext);
dcmd_ubij (playerid,params[])
{
new igrac;
if (PlayerInfo[playerid][pAdminLevel] <2)
{
SendClientMessage(playerid, COLOR_GRAD1, " Nisi Admin !");
}
if(strlen(params))
{
igrac = strval(params);
if(IsPlayerConnected(igrac))
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, 0x00FF00AA, " Ubio si igraca.");
}
else
{
SendClientMessage(playerid, 0x00FF00AA, " Igrac nije online.");
}
}
return 1;
}
dcmd_givehealth (playerid,params[])
{
new igrac2;
if (PlayerInfo[playerid][pAdminLevel] <2)
{
SendClientMessage(playerid, COLOR_GRAD1, " Nisi Admin !");
}
if(strlen(params))
{
igrac2 = strval(params);
if(IsPlayerConnected(igrac2))
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, 0x00FF00AA, " Izljecio si igraca.");
}
else
{
SendClientMessage(playerid, 0x00FF00AA, " Igrac nije online.");
}
}
return 1;
}
dcmd_setint0 (playerid,params[])
{
new igrac3;
if (PlayerInfo[playerid][pAdminLevel] <2)
{
SendClientMessage(playerid, COLOR_GRAD1, " Nisi Admin !");
}
if(strlen(params))
{
igrac3 = strval(params);
if(IsPlayerConnected(igrac3))
{
SetPlayerInterior(playerid, 100);
SendClientMessage(playerid, 0x00FF00AA, " Postavio si int igracu na 0.");
}
else
{
SendClientMessage(playerid, 0x00FF00AA, " Igrac nije online.");
}
}
return 1;
}
Nije nis posebno al mozda nekome posluzi.
Citat: [SampArena]Deo poslato Oktobar 21, 2010, 20:26:06 POSLE PODNE
Nije nis posebno al mozda nekome posluzi.
Mislim da neće nikome.
Komanda "givehealth" ima 10 znakova, a ne 4, i komanda "setint0" ima 7 znakova, a ne 4. I ne samo da je tu greÅ¡ka, nego je vrlo slabo optimizirana skripta i zaboravio si spomenuti da za ovo treba dcmd procesor + zaÅ¡to bi imao komandu "/setint0" samo za interiorID 0 kad možeÅ¡ imati "/setint [ID]"? I da si stavio pravi broj znakova komanda bi svejedno radila za sve igraÄe, i one koji nisu admini jer nisi zaustavio procesa (koristio bi return statement).
I komanda "/ubij" će ubiti onoga tko je bude koristio, isto tako će ostale komande raditi na onome tko ih bude koristio.
I sve u svemu, komanda je za Godfather / Godfather edit skriptu.
Evo jedna jednostavna /eject [ID] komanda
Ova komanda se moze koristiti za bilo koju skriptu ne samo GF i njevove edite
Za rad ove komande potrebno je:
- ZCMD procesor komandi > ZEEX
- SCCANF 2 - string splitter > Y_LESS
- GetName funkcija > ExtremePower
Na vrh skrive staviti:
#define SCM SendClientMessage
#define siva 0xAAAAAAFF
#define zuta 0xFFFF00FFCOMMAND:eject(playerid,params[])
{
new
id,
string[128];
if(sscanf(params, "u", id)) return SCM(playerid, siva, "Koristi: /eject [ID]");
else if (id == INVALID_PLAYER_ID) SCM(playerid, siva, "ERROR: Igrac nije online.");
else
{
if( id == playerid ) return SCM(playerid,siva,"ERROR: Nemozes sam sebe izbaciti iz vozila.");
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
if(!IsPlayerInAnyVehicle(id)) return SCM(playerid,siva,"ERROR: Taj igrac nije u vozilu.");
if(GetPlayerVehicleSeat(id) != 0) {
RemovePlayerFromVehicle(id);
format(string,sizeof string,"INFO: %s vas je izbacio iz vozila.",GetName(playerid));
SCM(id,zuta,string);
format(string,sizeof string,"INFO: Izbacio si %s van vaseg vozila.",GetName(id));
SCM(playerid,zuta,string); }
else
{
SCM(playerid,siva,"ERROR: Nemozes izbaciti vozaca van vozila.");
}
}
else
{
SCM(playerid,siva,"ERROR: Samo vozac ovog vozila moze izbacivati igrace van vozila.");
}
}
else
{
SCM(playerid,siva,"ERROR: Niste u vozilu.");
}
}
return true;
}
GetName(id)
stock GetName(id)
{
new
ime[MAX_PLAYER_NAME];
GetPlayerName(id,ime, MAX_PLAYER_NAME);
return ime;
}
Jednostavna /me komanda.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/me", true, 3))
{
if(cmdtext[3] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [radnja]");
return 1;
}
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
return 0;
}
Evo da se poÄisti chat:
#define ClearChat(%1,%2) for(new c; c < %2; c++) SendClientMessage(%1,0xFFFFFFAA," ") // Koristi: ClearChat(playerid, broj redova)
/* Primjer uporabe */
public OnPlayerConnect(playerid)
{
ClearChat(playerid, 15);
return true;
}
Citat: mafica .pwn poslato Januar 23, 2011, 17:10:10 POSLE PODNE
Jednostavna /me komanda.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/me", true, 3))
{
if(cmdtext[3] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [radnja]");
return 1;
}
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
return 0;
}
ovo je samo kad pises na obicnom chatu samo bez :
ako si hteo ovo za dm/stunt ili nesto slicno uredu je
ali za rp server moras koristiti ono ako je igrac blizu tog igraca da vidi to sto ovaj radi
npr da koristis ProxDetector iz GF
Citat: [IG]black_dota poslato Januar 25, 2011, 01:47:19 PRE PODNE
Citat: mafica .pwn poslato Januar 23, 2011, 17:10:10 POSLE PODNE
Jednostavna /me komanda.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/me", true, 3))
{
if(cmdtext[3] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [radnja]");
return 1;
}
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
return 0;
}
ovo je samo kad pises na obicnom chatu samo bez :
ako si hteo ovo za dm/stunt ili nesto slicno uredu je
ali za rp server moras koristiti ono ako je igrac blizu tog igraca da vidi to sto ovaj radi
npr da koristis ProxDetector iz GF
nestvaraj komplikacije bezveze.
postavio sam komandu a nisam neki PRO scripter,tako da 8)
Citat: mafica .pwn poslato Januar 23, 2011, 17:10:10 POSLE PODNE
Jednostavna /me komanda.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/me", true, 3))
{
if(cmdtext[3] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [radnja]");
return 1;
}
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
return 0;
}
Komanda:
CMD:me(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new
MeTxT,
string[180],
Ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, Ime, sizeof(Ime));
if(sscanf(params, "s", MeTxT)) return SendClientMessage(playerid, 0xFFFFFFFF, "@ /me <TxT> @");
format(string, sizeof(string), "* %s %s", Ime, MeTxT);
ProxDetector(30, playerid, string, 0xFFFFFFFF, 0xEFEFEFFF, 0xDFDFDFFF, 0xCFCFCFFF, 0xBFBFBFFF);
}
return false;
}
Napomena: ZCMD i SSCANF :)
ProxDetector:
stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
return 1;
}
to vec valja
#define IncreasePVarInt(%0,%1,%2) SetPVarInt(%0, %1, GetPVarInt(%0, %1) + %2)
IncreasePVarInt(playerid, "Respekti", 1);
Credits: Correlli
Ovo je za povecavanje PVarova
CMD:b(playerid, params[])
{
new BChat[128], pName[MAX_PLAYER_NAME], Text[128];
if(sscanf(params, "s[128]", Text)) return SendClientMessage(playerid, 0xFFFFFFFF, "{76EC00}Koristi |{FFFFFF} /b <txt>");
GetPlayerName(playerid, pName, sizeof(pName));
format(BChat, sizeof(BChat), "%s govori: (( %s ))", pName, params);
ProxDetector(30.0, playerid, BChat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
return 1;
}
Evo jednostavna /b komanda koju sam ja koristio.. :)
NAPOMENA: Trebate imati ZCMD i SSCANF :)
-Definicije
#define SCM SendClientMessage
#define ZUTA 0xFFFF00AA
#define LJUBICASTA 0xC2A2DAAA
#define CRVENA 0xAA3333AA
CMD:setskin(playerid,params[])
{
new Id,skin,string[128],ime[MAX_PLAYER_NAME],ime2[MAX_PLAYER_NAME],
Float:X,Float:Y,Float:Z;
GetPlayerName(playerid,ime, MAX_PLAYER_NAME);
if (sscanf(params, "ud", Id,skin)) SendClientMessage(playerid, ZUTA, "Komanda: /setskin [IgracevID/DeoImena] [ID skina]");
else if (Id == INVALID_PLAYER_ID) SendClientMessage(playerid, CRVENA, "[Greska]: Taj igrac je Offline !");
else
{
if(PlayerInfo[playerid][Admin] >= 2)
{
GetPlayerPos(Id,X,Y,Z);
GetPlayerName(playerid,ime2, MAX_PLAYER_NAME);
SetPlayerSkin(Id,skin);
format(string, sizeof string,"[Admin] %s ti je namestio skin ID: %d",ime,skin);
SCM(Id,COLOR_TEXT,string);
PlayerPlaySound(playerid, 1057, X, Y, Z);
PlayerPlaySound(Id, 1057, 0.0, 0.0, 0.0);
format(string, sizeof string,"Namestio si: %s skin id %d",ime2,skin);
SCM(playerid,LJUBICASTA,string);
}
else
{
SCM(playerid,CRVENA,"[Greska]: Moras biti Admin:lvl2 za ovu komandu !");
}
}
return 1;
}
PS: Da bi ova komanda radila potrebno vam je sledece:
ZCMD procesor ----> http://solidfiles.com/d/879d1213462fc1562d16d464e90c8cf9/ (http://solidfiles.com/d/879d1213462fc1562d16d464e90c8cf9/)
SSCANF2 -----> http://forum.sa-mp.com/showthread.php?t=120356&highlight=sscanf (http://forum.sa-mp.com/showthread.php?t=120356&highlight=sscanf)
joxy ova komanda nece pomoci nikome,zbog PlayerInfo[playerid][Admin] i ima tu jos manjih greski..
fix:
CMD:setskin(playerid, params[])
{
new ID,skinid,ime[MAX_PLAYER_NAME],ime1[MAX_PLAYER_NAME],s[68],s1[68];
if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xC2A2DAAA, "Niste ovlasteni");
if (sscanf(params, "ud", ID,skinid)) SendClientMessage(playerid, 0xC2A2DAAA, "Komanda: /setskin [IgracevID/DeoImena] [ID skina]");
if (ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xAA3333AA, "[Greska]: Taj igrac je Offline !");
GetPlayerName(playerid, ime, sizeof(ime));
GetPlayerName(ID, ime1, sizeof(ime1));
format(s, sizeof(s), "%s vam je promenio skin", ime);
format(s1, sizeof(s1), "Promenili ste skin %s-u", ime1);
SendClientMessage(ID, 0xC2A2DAAA, s);
SendClientMessage(playerid, 0xC2A2DAAA, s1);
SetPlayerSkin(ID, skinid);
return true;
}
Citat: eXtreme poslato Januar 26, 2011, 20:43:35 POSLE PODNE
Nemamo Mexico mod komanda nije korisna...
A zaÅ¡to trebaÅ¡ imati mexico roleplay da bi komanda radila, sada ste naÅ¡li problem u kodu za provjeru jeli igraÄ administrator?
Pa eto hot fix:
COMMAND:setskin(playerid,params[])
{
new
id,
skin,
string[128]
;
if (sscanf(params, "ud", id,skin)) SCM(playerid, ZUTA, "Komanda: /setskin [Igracevid/DeoImena] [id skina]");
else if (id == INVALid_PLAYER_id) SCM(playerid, CRVENA, "[Greska]: Taj igrac je Offline !");
//if(PlayerInfo[playerid][Admin] < 2) return SCM(playerid,CRVENA,"[Greska]: Moras biti Admin:lvl2 za ovu komandu !");
/*
PROVJERA ZA GF MODOVE, IsPlayerAdmin gore, ako ne koristiš GF onda stavi provjeru na svoj naćin
*/
else
{
SetPlayerSkin(id,skin);
format(string, sizeof string,"[Admin] %s ti je namestio skin id: %d",Ime(playerid),skin);
SCM(id,COLOR_TEXT,string);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
PlayerPlaySound(id, 1057, 0.0, 0.0, 0.0);
format(string, sizeof string,"Namestio si: %s skin id %d",Ime(id),skin);
SCM(playerid,LJUBICASTA,string);
}
return true;
}
stock Ime(id)
{
new
ime[MAX_PLAYER_NAME]
;
GetPlayerName(id, ime, MAX_PLAYER_NAME);
return ime;
}
zar ne treba INVALID_PLAYER_ID ?
Komanda Hesoyam iz GTA SA SP :P
if(strcmp(cmdtext, "/hesoyam", true) == 0)
{
GivePlayerMoney(playerid, 250000);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
RepairVehicle(vehicleid);
return 1;
}
Citat: oO° HarisZornic °Oo poslato Januar 26, 2011, 23:30:13 POSLE PODNE
Komanda Hesoyam iz GTA SA SP :P
if(strcmp(cmdtext, "/hesoyam", true) == 0)
{
GivePlayerMoney(playerid, 250000);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
RepairVehicle(vehicleid);
return 1;
}
Nece radit, nisi definiro vehicleid :)
Hotfix:
CMD:hesoyam(playerid,params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerMoney(playerid,250000);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
if(IsPlayerInAnyVehicle(playerid)) return RepairVehicle(vehicleid);
return 1;
}
Sry sto idem Offtopic
@BloodMaster, jer ce to tvoje popraviti i masku auta ili samo motor?
Citat: oO° HarisZornic °Oo poslato Januar 26, 2011, 23:30:13 POSLE PODNE
Komanda Hesoyam iz GTA SA SP :P
if(strcmp(cmdtext, "/hesoyam", true) == 0)
{
GivePlayerMoney(playerid, 250000);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
RepairVehicle(vehicleid);
return 1;
}
http://www.larsey123.pastebin.com/9dHw20LM (http://www.larsey123.pastebin.com/9dHw20LM)
http://www.larsey123.pastebin.com/FPjhF9q5 (http://www.larsey123.pastebin.com/FPjhF9q5)
ccc :)
Evo komanda..
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(dajlovu, 7, cmdtext);
return 0;
}
dcmd_dajlovu(playerid, params[])
{
new giveplayerid;
new kolko;
if (sscanf(params, "ud", giveplayerid, kolko)) SendClientMessage(playerid, 0xFF0000AA, "/dajlovu [id] [koliko]");
else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "ID nije nadjen");
else if (kolko > GetPlayerMoney(playerid)) SendClientMessage(playerid, 0xFF0000AA, "Nema dovoljno novca");
else
{
GivePlayerMoney(giveplayerid, kolko);
GivePlayerMoney(playerid, 0 - kolko);
SendClientMessage(playerid, 0x00FF00AA, "Novac Poslan");
SendClientMessage(giveplayerid, 0x00FF00AA, "Novac primljen");
}
return 1;
}
Citat: [IG]black_dota poslato Januar 26, 2011, 21:10:46 POSLE PODNE
zar ne treba INVALID_PLAYER_ID ?
Mala greška
Citat: oO° HarisZornic °Oo poslato Januar 26, 2011, 23:30:13 POSLE PODNE
Komanda Hesoyam iz GTA SA SP :P
if(strcmp(cmdtext, "/hesoyam", true) == 0)
{
GivePlayerMoney(playerid, 250000);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
RepairVehicle(vehicleid);
return 1;
}
Ali u single player-u ne možeÅ¡ staviti '/' !? Evo realnog naÄina
public OnPlayerText(playerid, text[])
{
new
vehicleid = GetPlayerVehicleID(playerid)
;
if(!strcmp(text,"hesoyam"))
{
GivePlayerMoney(playerid, 250000);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
if(IsPlayerInAnyVehicle(playerid))
{
RepairVehicle(vehicleid);
}
return false;
}
return true;
}
Suprotno IncreasePVarInt();
#define DecreasePVarInt(%0,%1,%2) SetPVarInt(%0, %1, GetPVarInt(%0, %1) - %2)
DecreasePVarInt(playerid, "Money", 100);
Služi za smanjivanje PVar-ova.
Citat: Paradox poslato Januar 27, 2011, 15:00:35 POSLE PODNE
Suprotno IncreasePVarInt();
#define DecreasePVarInt(%0,%1,%2) SetPVarInt(%0, %1, GetPVarInt(%0, %1) - %2)
DecreasePVarInt(playerid, "Money", 100);
Služi za smanjivanje PVar-ova.
Pogledaj moju macro funkciju za to:
#define SetPVarIntEx(%0,%1,%2,%3) SetPVarInt(%0, %1, GetPVarInt(%0, %1) %2 %3)
Jednostavnije je:
SetPVarIntEx(playerid,"Nesto",+,5);
ili
SetPVarIntEx(playerid,"Nesto",-,5);
Iako koristi 4 parametra ja mislim da je jednostavnije koristiti jednu funkciju nego dvije? ;)
Citat: [H]265 poslato Januar 27, 2011, 15:04:41 POSLE PODNE
Citat: Paradox poslato Januar 27, 2011, 15:00:35 POSLE PODNE
Suprotno IncreasePVarInt();
#define DecreasePVarInt(%0,%1,%2) SetPVarInt(%0, %1, GetPVarInt(%0, %1) - %2)
DecreasePVarInt(playerid, "Money", 100);
Služi za smanjivanje PVar-ova.
Pogledaj moju macro funkciju za to:
#define SetPVarIntEx(%0,%1,%2,%3) SetPVarInt(%0, %1, GetPVarInt(%0, %1) %2 %3)
Jednostavnije je:
SetPVarIntEx(playerid,"Nesto",+,5);
ili
SetPVarIntEx(playerid,"Nesto",-,5);
Iako koristi 4 parametra ja mislim da je jednostavnije koristiti jednu funkciju nego dvije? ;)
Naravno da je jednostavnije. :) Samo se nisam sjetio da bi se to moglo i tako napraviti, ali evo ti si se sjetio i to je to. ;)
Ovaj topic sluzi za "Korisne komande" ne funkcije...
Za funkcije imate ovdje:
http://balkan-samp.com/forum/index.php?topic=4245.0 (http://balkan-samp.com/forum/index.php?topic=4245.0)
Evo jedne komande koju mislim da svako moze da napravi i ubaci xD,mada cini mi se da sam video da ljudi traze to ,ali evo je.Ja sam je bez problema,uz malo pomoci iz drugih skripti nekako namestio xD mada je ovo za mene pocetnika solidno :D :D
Komanda sluzi da vam prikaze RP Pravila u igrici,znaci ako je igrac nov , i zeli da nauci pravila,kuca /rppravila i u dialogu dobije objasnjenje :D
Znam da nije nesto specijalno,ali evo ako nekom mozda posluzi bar kao primer :)
//-------------------------------[RP PRAVILA]--------------------------------------------
if(strcmp(cmd, "/rprules", true) == 0 || strcmp(cmd, "/rppravila", true) == 0)
{
if(IsPlayerConnected(playerid))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "RP Pravila:","RP(RolePlay)Simulacija stvarnog zivota\nSK(SpawnKill)Ubijanje na mestu Spawna\nMG(MetaGaming)Mesanje IC i OOC chata\nPG(PowerGaming)Nemoguca radnja\nBH(BunnyHopping)Skakanje i trcanje u isto vreme\nDM(DeathMaching)Ubijanje ljudi bez razloga\nNJ-kradja auta bez /me komandi\nBA(Bug Abusing)Iskoriscavanje propusta na serveru\nNadamo se da ste naucili ova pravila,jer ako ih ne postujete,mozete dobiti warn ili ban. !", "Shvatam","Izadji");
}
return 1;
}
Ovo je ceo red koji se stavlja tamo u komande...
//-------------------------------[RP PRAVILA]--------------------------------------------
CMD:rppravila(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "RP Pravila:","RP(RolePlay)Simulacija stvarnog zivota\nSK(SpawnKill)Ubijanje na mestu Spawna\nMG(MetaGaming)Mesanje IC i OOC chata\nPG(PowerGaming)Nemoguca radnja\nBH(BunnyHopping)Skakanje i trcanje u isto vreme\nDM(DeathMaching)Ubijanje ljudi bez razloga\nNJ-kradja auta bez /me komandi\nBA(Bug Abusing)Iskoriscavanje propusta na serveru\nNadamo se da ste naucili ova pravila,jer ako ih ne postujete,mozete dobiti warn ili ban. !", "Shvatam","Izadji");
}
return 1;
}
Ljepše je u ZCMD i brže je :)
CMD:rppravila(playerid, params[])
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "RP Pravila:","RP(RolePlay)Simulacija stvarnog zivota\nSK(SpawnKill)Ubijanje na mestu Spawna\nMG(MetaGaming)Mesanje IC i OOC chata\nPG(PowerGaming)Nemoguca radnja\nBH(BunnyHopping)Skakanje i trcanje u isto vreme\nDM(DeathMaching)Ubijanje ljudi bez razloga\nNJ-kradja auta bez /me komandi\nBA(Bug Abusing)Iskoriscavanje propusta na serveru\nNadamo se da ste naucili ova pravila,jer ako ih ne postujete,mozete dobiti warn ili ban. !", "Shvatam","Izadji");
return 1;
}
Sredio sam :)
GFovci, šta će vam IsPlayerConnected funkcija? Dok nešto takvog vidim u ovakvoj kodi za komandu, odma znam da nije korisno.
Evo korisna komanda koja provjerava RCON admine
if (!strcmp("/admini", cmdtext, true))
{
new string[32];
SendClientMessage(playerid, 0xAFAFAFAA,"-_-_-RCON Admini online-_-_-");
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(playerid))
{
format(string, 32, "%s(%d)",name[i],i);
SendClientMessage(playerid, 0x1E90FFAA, string);
}
}
return 1;
}
Ovo stavite pod OnPlayerCommandText
GetPlayerName(playerid, 24, name[playerid])
Ovo stavite pod OnPlayerConnect
new name[MAX_PLAYERS][24];
Ovo stavite na vrh skripte
Citat: Correlli poslato Februar 10, 2011, 17:37:47 POSLE PODNE
GFovci, šta će vam IsPlayerConnected funkcija? Dok nešto takvog vidim u ovakvoj kodi za komandu, odma znam da nije korisno.
a kako bi onda trebalo izgledat, da bi nest bilo korisno?
Citat: [NS]Michael poslato Mart 03, 2011, 21:50:39 POSLE PODNE
Citat: Correlli poslato Februar 10, 2011, 17:37:47 POSLE PODNE
GFovci, šta će vam IsPlayerConnected funkcija? Dok nešto takvog vidim u ovakvoj kodi za komandu, odma znam da nije korisno.
a kako bi onda trebalo izgledat, da bi nest bilo korisno?
Optimizirano... I korisno. ::)
Citat: Vilko | ♦ ♣ ♥ ♠» poslato Mart 03, 2011, 19:51:13 POSLE PODNE
Evo korisna komanda koja provjerava RCON admine
if (!strcmp("/admini", cmdtext, true))
{
new string[32];
SendClientMessage(playerid, 0xAFAFAFAA,"-_-_-RCON Admini online-_-_-");
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(playerid))
{
format(string, 32, "%s(%d)",name[i],i);
SendClientMessage(playerid, 0x1E90FFAA, string);
}
}
return 1;
}
Ovo stavite pod OnPlayerCommandText
GetPlayerName(playerid, 24, name[playerid])
Ovo stavite pod OnPlayerConnect
new name[MAX_PLAYERS][24];
Ovo stavite na vrh skripte
Sto ne koristis FOREACH? i ZCMD?
Jer vecina koristi obicni strcmp?
1. if (!strcmp("/admini", cmdtext, true))
2. {
3. new string[32];
4. SendClientMessage(playerid, 0xAFAFAFAA,"-_-_-RCON Admini online-_-_-");
5.
6. for(new i; i < MAX_PLAYERS; i++)
7. {
8. if(IsPlayerAdmin(i))
9. {
10. format(string, 32, "%s(%d)",name<i>,i);
11. SendClientMessage(playerid, 0x1E90FFAA, string);
12. }
13. }
14. return 1;
15. }
nije ti ovo gore valjalo ;)
Citat: ProGaming|Pacino poslato Mart 20, 2011, 22:55:07 POSLE PODNE
1. if (!strcmp("/admini", cmdtext, true))
2. {
3. new string[32];
4. SendClientMessage(playerid, 0xAFAFAFAA,"-_-_-RCON Admini online-_-_-");
5.
6. for(new i; i < MAX_PLAYERS; i++)
7. {
8. if(IsPlayerAdmin(i))
9. {
10. format(string, 32, "%s(%d)",name<i>,i);
11. SendClientMessage(playerid, 0x1E90FFAA, string);
12. }
13. }
14. return 1;
15. }
nije ti ovo gore valjalo ;)
Sta si ti novo tu dodao? I nevjerujem da ce radit na GF, Raven i ostalim EDITima..
I naravno nece radit ako nisi dodao ostatak onoga ;)
vidis da je kod njega bilo
if(IsPlayerAdmin(playerid))
u "for", a treba biti
if(IsPlayerAdmin(i))
:S
Inspirisan jednom lepoticom , najboljom adminicom na DDC serveru (Asiom) Zna je Nik napravio sam ovu za nju jako korisnu komandu (ovo je komanda ono "ludilo"):
CMD:smash(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nisi Administrator");
new ID;
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "/smash (ID)");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1,"Korisnik nije prisutan");
if(!IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, -1,"Korisnik nije u vozliu");
SetVehicleVelocity(GetPlayerVehicleID(ID), 0.0, 0.0, 100);
SetTimerEx("Velecity", 500, false, "u", ID);
return 1;
}
forward Velecity(playerid);
public Velecity(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, -300);
return 1;
}
PS. Rcon Administratori samo!
cemu sluzi ta komanda ne kuzim ??
Citat: System32 poslato April 27, 2011, 22:35:36 POSLE PODNE
cemu sluzi ta komanda ne kuzim ??
Polomiti/Razlupati/Smrviti (http://translate.google.rs/?hl=sr&tab=wT#en%7Csr%7CSmash)
SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, -300);
Ovaj -300 ti je na z koordinati. z - Visina, znaci ovo ce ga zbombat u pod XD To je najbolje ako vozi avion
Evo jedne komande koju sam napravio možda nekome pomogne...Da si olakšate skriptanje itd itd...
COMMAND:setpos(playerid,params[]) // by [H]265
{
new
Float:Pos[4],
id,
interior,
vw,
ime[MAX_PLAYER_NAME],
string[128];
#define SCM(%0,%1,%2) SendClientMessage(%0,%1,%2)
if(sscanf(params,"ufffdd",id,Pos[1],Pos[2],Pos[3],interior,vw)) return SCM(playerid,siva,"KORISTI: /setpos [playerid] [PosX] [PosY] [PosZ] [Interior] [VirtualWorld].");
else if(id == INVALID_PLAYER_ID) return SCM(playerid, siva,"SERVER. Igrac sa tim ID-om nije online.");
else
{
GetPlayerName(id, ime, MAX_PLAYER_NAME);
SetPlayerPos(playerid, Pos[1], Pos[2], Pos[3]);
SetPlayerInterior(playerid, interior);
SetPlayerVirtualWorld(playerid, vw);
format(string, sizeof string, "SERVER: Admin '%s' te premjestio na drugu lokaciju: INTERIOR: %d | VIRTUAL: %d",ime,interior,vw);
SCM(id, plava, string);
SCM(playerid, plava, "Uspjesno si promjenio kordinate igracu!");
}
return true;
}
PRIMJER:
/setpos 0 2200.3210 -1453.3831 24.5379 0 0
i to će igraća sa ID- 0 prebaciti na kordinate 2200.3210,-1453.3831,24.5379 i interior i virtual world će mu se setati na 0
DEFINE BOJA:
new
plava = 0x00B9FFFF,
siva = 0xAAAAAAFF;
Citat: [H]265 poslato Maj 13, 2011, 16:33:27 POSLE PODNE
Evo jedne komande koju sam napravio možda nekome pomogne...Da si olakšate skriptanje itd itd...
COMMAND:setpos(playerid,params[]) // by [H]265
{
new
Float:Pos[4],
id,
interior,
vw,
ime[MAX_PLAYER_NAME],
string[128];
#define SCM(%0,%1,%2) SendClientMessage(%0,%1,%2)
if(sscanf(params,"ufffdd",id,Pos[1],Pos[2],Pos[3],interior,vw)) return SCM(playerid,siva,"KORISTI: /setpos [playerid] [PosX] [PosY] [PosZ] [Interior] [VirtualWorld].");
else if(id == INVALID_PLAYER_ID) return SCM(playerid, siva,"SERVER. Igrac sa tim ID-om nije online.");
else
{
GetPlayerName(id, ime, MAX_PLAYER_NAME);
SetPlayerPos(playerid, Pos[1], Pos[2], Pos[3]);
SetPlayerInterior(playerid, interior);
SetPlayerVirtualWorld(playerid, vw);
format(string, sizeof string, "SERVER: Admin '%s' te premjestio na drugu lokaciju: INTERIOR: %d | VIRTUAL: %d",ime,interior,vw);
SCM(id, plava, string);
SCM(playerid, plava, "Uspjesno si promjenio kordinate igracu!");
}
return true;
}
PRIMJER:
/setpos 0 2200.3210 -1453.3831 24.5379 0 0
i to će igraća sa ID- 0 prebaciti na kordinate 2200.3210,-1453.3831,24.5379 i interior i virtual world će mu se setati na 0
DEFINE BOJA:
new
plava = 0x00B9FFFF,
siva = 0xAAAAAAFF;
Jednostavna i laka komanda , dosta će pomoći poÄetnicima.
Citat: Disney Channel poslato Maj 13, 2011, 16:50:29 POSLE PODNE
Jednostavna i laka komanda , dosta će pomoći poÄetnicima.
Ne radi se tu dali je laka ili teška, kada je korisna.
Hvala ti puno za ovo Float:Pos[4],
toga se nisam mogao setiti i uvek kao kreten pisem X, Y, Z ovako je brze i bolje![/b]
Lepa komanda!
Citat: eXtreme poslato Maj 13, 2011, 18:22:30 POSLE PODNE
Hvala ti puno za ovo Float:Pos[4],
toga se nisam mogao setiti i uvek kao kreten pisem X, Y, Z ovako je brze i bolje![/b]
Lepa komanda!
Naravno da je , ja stalno koristim array za pozicije.
Citat: eXtreme poslato Maj 13, 2011, 18:22:30 POSLE PODNE
Hvala ti puno za ovo Float:Pos[4], toga se nisam mogao setiti i uvek kao kreten pisem X, Y, Z ovako je brze i bolje!
Citat: Disney Channel poslato Maj 13, 2011, 18:49:59 POSLE PODNE
Naravno da je , ja stalno koristim array za pozicije.
Array se ne koristi samo za pozicije možeš ti i npr. vozila definirati sa array-om
npr.
new VOZILO_TAXI[5];
VOZILO_TAXI[1] = CreateVehicle...
VOZILO_TAXI[2] = CreateVehicle...
VOZILO_TAXI[3] = CreateVehicle...
VOZILO_TAXI[4] = CreateVehicle...
Samo ću reći da mislim da je array malo ipak sporiji od normalnog naÄina ali je zato urednije
Evo jedna moja komanda za aute stvarat.
INCLUDE:
#include <zcmd>
#include <sscanf2>
DEFINICIJE:
#define COLOR_ORANGE 0xFF8040FF
CMD:veh(playerid, params[])
{
if(GetPVarInt(playerid, "Admin") >= 2) // ovdje ide kako ste vi namjestili definiciju admina
{
new vID, Cl1, Cl2;
new Float:X, Float:Y, Float:Z, Float:Ang;
if(sscanf(params, "ii", vID, Cl1, Cl2)) return SendClientMessage(playerid, COLOR_ORANGE, "{0000FF}[SX:RP | KOMANDA]:{FF8040} /veh <vehicleid> <boja1> <boja2>");
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
CreateVehicle(vID, X + 5.0, Y, Z, Ang, Cl1, Cl2, 1200000);
}
else SendClientMessage(playerid, COLOR_RED, "[ERROR]: Nisi Admin!");
return 1;
}
Komanda je testirana jer sam je napravio za svoj RP mod. (nula ;) )
Pošto je ova komanda u zcmd vi nju ne možete staviti u OnPlayerCommandText nego izvan tog callback - a jer neće raditi
EdiT: Hvala eXtreme ja skroz zaboravia na to..
Bolje i urednije ;)
CMD:veh(playerid, params[])
{
new
vID,
Cl1,
Cl2,
Float:X,
Float:Y,
Float:Z,
Float:Ang;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[ERROR]: Nisi Admin!");
if(sscanf(params, "ii", vID, Cl1, Cl2)) return SendClientMessage(playerid, COLOR_ORANGE, "{0000FF}[SX:RP | KOMANDA]:{FF8040} /veh <vehicleid> <boja1> <boja2>");
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
CreateVehicle(vID, X + 5.0, Y, Z, Ang, Cl1, Cl2, 1200000);
return true;
}
@[H]265
Znam to za vozila, ali nikad nisam pokusavao sa Float, malo jeste sporije ali preglednije kao sto si i rekao!
@[AG] aleluja
Tebi i admin lvl 0 moze tu komandu?
Citat: eXtreme poslato Maj 14, 2011, 10:16:16 PRE PODNE
Bolje i urednije ;)
CMD:veh(playerid, params[])
{
new
vID,
Cl1,
Cl2,
Float:X,
Float:Y,
Float:Z,
Float:Ang;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[ERROR]: Nisi Admin!");
if(sscanf(params, "ii", vID, Cl1, Cl2)) return SendClientMessage(playerid, COLOR_ORANGE, "{0000FF}[SX:RP | KOMANDA]:{FF8040} /veh <vehicleid> <boja1> <boja2>");
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
CreateVehicle(vID, X + 5.0, Y, Z, Ang, Cl1, Cl2, 1200000);
return true;
}
@[H]265
Znam to za vozila, ali nikad nisam pokusavao sa Float, malo jeste sporije ali preglednije kao sto si i rekao!
@[AG] aleluja
Tebi i admin lvl 0 moze tu komandu?
Nek je urednije tako,meni je nako lakše :P
Evo jedna komanda.. pošto nemogu pisat DP :PCMD:iskljucitagove(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid, crvena,"[ERROR] Nisi admin!!");
else {
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false)
SCM(playerid,tvojaboja,"UspjeÅ¡no si ukljuÄio name tagove!"); }
return true; }
I sada da ih nazad ukljuÄiÅ¡CMD:ukljucitagove(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid, crvena,"[ERROR] Nisi admin!!");
else {
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, true)
SCM(playerid,tvojaboja,"UspjeÅ¡no si ukljuÄio name tagove!"); }
return true; }
Ovo nisan testira .. nadan se da će valjat..
Ovo san najviÅ¡e napravia poÅ¡to vidim da mnogi snimaju filmove a i piÅ¡e im name tagovi .. A i sićan se da je prije na CH ovakva sliÄna komanda napravljena..
bool:tag[MAX_PLAYERS];
CMD:tag(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1,"[ERROR] Nisi admin!!");
if(tag[playerid] == false)
{
tag[playerid] = true;
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(playerid, i, true);
SendClientMessage(playerid, -1,"ON");
return true;
}
else
{
tag[playerid] = false;
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(playerid, i, false);
SendClientMessage(playerid, -1,"OFF");
return true;
}
}
Citat: eXtreme poslato Januar 26, 2011, 14:40:40 POSLE PODNE
Komanda:
CMD:me(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new
MeTxT,
string[180],
Ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, Ime, sizeof(Ime));
if(sscanf(params, "s", MeTxT)) return SendClientMessage(playerid, 0xFFFFFFFF, "@ /me <TxT> @");
format(string, sizeof(string), "* %s %s", Ime, MeTxT);
ProxDetector(30, playerid, string, 0xFFFFFFFF, 0xEFEFEFFF, 0xDFDFDFFF, 0xCFCFCFFF, 0xBFBFBFFF);
}
return false;
}
Napomena: ZCMD i SSCANF :)
ProxDetector:
stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
return 1;
}
Ovo ne radi 8)
Stavi ovako:CMD:me(playerid, params[])
{
new
s[80],
s1[180],
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
if(sscanf(params, "s", s)) return SendClientMessage(playerid, 0xFFFFFFFF, "@ /me <TxT> @");
format(s1, sizeof(s1), "* %s %s", pName, s);
ProxDetector(30, playerid, s1, 0xFFFFFFFF, 0xEFEFEFFF, 0xDFDFDFFF, 0xCFCFCFFF, 0xBFBFBFFF);
return true;
}
Credits: Aleksandar
Jesi ti poceo to namerno da radis?
Ja sam ti pokazao kako treba, gore...
I kako je bolje, inace ona komanda je preuzeta sa wiki (http://wiki.sa-mp.com/wiki/ShowPlayerNameTagForPlayer).
Nemaju svi SCM, kao i definisanu crvenu boju...
Citat: eXtreme poslato Maj 22, 2011, 19:11:13 POSLE PODNE
Jesi ti poceo to namerno da radis?
Ja sam ti pokazao kako treba, gore...
I kako je bolje, inace ona komanda je preuzeta sa wiki (http://wiki.sa-mp.com/wiki/ShowPlayerNameTagForPlayer).
Nemaju svi SCM, kao i definisanu crvenu boju...
Å¡ta san poÄea namjerno radit? :s
Nije preuzeta s wiki nego odavde:
Citat: [AG] BloodMaster poslato April 26, 2011, 17:15:02 POSLE PODNE
Citat: [Banana$]ReadMe.txt poslato April 26, 2011, 16:23:24 POSLE PODNE
Dakle ja radim Wild Wild West OWAA, gdje nece biti NameTagova,
p
Jednostavno ispod OnPlayerSpawn stavite:
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
Evo sa zcmd posto neznam radit sa sscanf.
Malo pogledaj tutorijale i videces sta je sscanf...
ZCMD procesor komandi a sscanf je nesto drugo...
lol pa vidis da je sscanf, laggan je sscanf, samo trebas ucit tako sam i ja mislio, ja u opce neznam raditi sa strok kako vec i strcmp, sad dosta offtopica
OOC system by: aleluja !
Evo moj OOC system - nadan se da ću olakšat posao onima koji radu mod od nule
VRH:
#include <zcmd>
#include <sscanf>
#define narancasta 0xFF8040FF
#define SEAL 0xBFEFFFAA
#define zuta 0xFFFF00AA
new OOC = 0;
CMD:o(playerid, params[])
{
new oMsg[128], pName[MAX_PLAYER_NAME];
if(OOC == 1)
{
new Text[128];
if(sscanf(params, "s", Text)) return SendClientMessage(playerid, narancasta, "KORISTI: /o <text>");
GetPlayerName(playerid, pName, sizeof(pName));
format(oMsg, sizeof(oMsg), "(( %s: %s ))", pName, params);
SendClientMessageToAll(SEAL, oMsg);
}
else if(!IsPlayerAdmin(playerid))
{
new Text[128];
if(sscanf(params, "s", Text)) return SendClientMessage(playerid, narancasta, "KORISTI: /o <text>");
GetPlayerName(playerid, pName, sizeof(pName));
format(oMsg, sizeof(oMsg), "(( Admin %s: %s ))", pName, params);
SendClientMessageToAll(zuta, oMsg);
}
else SendClientMessage(playerid, crvena, "[OOC]: OOC Chat je iskljucen.");
return 1;
}
CMD:ukljucio(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
{
new oMsg[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(oMsg, sizeof(oMsg), "[OOC]: Admin %s je ukljucio OOC Chat", pName);
SendClientMessageToAll(narancasta, oMsg);
OOC = 1;
}
return 1;
}
CMD:iskljucio(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
{
new oMsg[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(oMsg, sizeof(oMsg), "[OOC]: Admin %s je iskljucio OOC Chat", pName);
SendClientMessageToAll(narancasta, oMsg);
OOC = 0;
}
return 1;
}
Nadam se da sam nekome pomogao! ;)
u sscanfu moras stavis s[128] (Ili neku drugu valutu) Jer ce onda doci do bugova odnosno neces se cijeli tekst prikazati, najbolje je staviti s[128]
Citat: [AG] System32 poslato Jun 06, 2011, 13:55:04 POSLE PODNE
u sscanfu moras stavis s[128] (Ili neku drugu valutu) Jer ce onda doci do bugova odnosno neces se cijeli tekst prikazati, najbolje je staviti s[128]
Kada sam to stavljao nije mi se pojavljao text (s[128]), kad sam tako stavio radi ko švicarski :D
Citat: aleluja poslato Jun 06, 2011, 18:01:16 POSLE PODNE
Citat: [AG] System32 poslato Jun 06, 2011, 13:55:04 POSLE PODNE
u sscanfu moras stavis s[128] (Ili neku drugu valutu) Jer ce onda doci do bugova odnosno neces se cijeli tekst prikazati, najbolje je staviti s[128]
Kada sam to stavljao nije mi se pojavljao text (s[128]), kad sam tako stavio radi ko švicarski :D
U konzoli ti sve pise
cmd_pogledajnovcanik(playerid,params[])
{
new id;
new string[128];
if(GetPlayerWeapon(playerid) == 24)
{
if (strlen(params))
{
id = strval(params);
if (IsPlayerConnected(id))
{
format(string, sizeof(string), "Taj igrac ima %i$", GetPlayerMoney(id));
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "[ERROR]: Igrac nije online.");
}
}
else
{
SendClientMessage(playerid, COLOR_ADMININFO, "[KOMANDA]: /pogledajnovcanik [PLAYERID]");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Moras imati pistolj.");
}
return 1;
}
dcmd(pogledajnovcanik,16,cmdtext);
//To stavi ispod
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(pogledajnovcanik,16,cmdtext);
}
Evo komanda za izljecivanje cjelog servera
CMD:healall(playerid ,params[])
{
new string[99];
if(PlayerInfo[playerid][Admin] < 4) return SendClientMessage(playerid, CRVENA, "[ERROR] Nemas ovlastenje za ovu komandu!");
format(string, sizeof(string), "[HEAL-ALL] Administrator %s je izlecio sve na serveru.", ImeIgraca(playerid));
SendClientMessageToAll(SVETLOPLAVA, string);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
SetPlayerHealth(i, 100);
}
}
return 1;
}
I komanda /gotols
CMD:portls(playerid ,params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Admin] >= 1 || PlayerInfo[playerid][pGameMaster] >= 1)
{
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
}
SendClientMessage(playerid, CRVENA, " Teleportiraliste se u LOS SANTOS!!!");
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
}
else
{
SendClientMessage(playerid, CRVENA, "Nemozete koristiti ovu komandu (Niste admin/gm)!!!");
}
}
return 1;
}
Evo komande za mute svih igraca :
if (strcmp("/muteall", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
foreach (Player, i)
{
if(PlayerInfo[i][pMuted] == 0)
{
PlayerInfo[i][pMuted] = 1;
}
}
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("[Admin]: %s je oduzeo mogucnost govora svim igracima",sendername);
format(string, sizeof(string), "[Admin]: %s je oduzeo pravo govora svim igracima",sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Niste ovlasceni da koristite ovu komandu !");
}
}
return 1;
}
I za unmute svih igraca :
if (strcmp("/unmuteall", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
foreach (Player, i)
{
if(PlayerInfo[i][pMuted] == 1)
{
PlayerInfo[i][pMuted] = 0;
}
}
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("[Admin]: %s je omogucio govor svim igracima",sendername);
format(string, sizeof(string), "[Admin]: %s je omogucio govor svim igracima",sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Niste ovlasceni da koristite ovu komandu !");
}
}
return 1;
}
Å ta ako neko nema u modu: SVETLOPLAVA, CRVENA, COLOR_LIGHTRED, COLOR_WHITE, COLOR_RED, COLOR_ADMININFO ?
Citat: aleluja poslato Jun 17, 2011, 15:48:23 POSLE PODNE
Å ta ako neko nema u modu: SVETLOPLAVA, CRVENA, COLOR_LIGHTRED, COLOR_WHITE, COLOR_RED, COLOR_ADMININFO ?
definira...XD
Citat: aleluja poslato Jun 17, 2011, 15:48:23 POSLE PODNE
Å ta ako neko nema u modu: SVETLOPLAVA, CRVENA, COLOR_LIGHTRED, COLOR_WHITE, COLOR_RED, COLOR_ADMININFO ?
Pa valjda zna naci u nekom gmu i dodat :D
#define SVETLOPLAVA 0x33CCFFAA
#define CRVENA 0xAA3333AA
#define BELA 0xFFFFFFAAitd.. :D
@[CH:FR][NB]SrKi_KinG
To uopste nije korisno jer je samo za GF mod...
Evo jos jedna komanda (/nitro)!Ako ocete za svoj stunt/dm/race server,onda izbacite ovo if (playerinfo[playerid][admin] 1 i ovo za gm-a)
if(strcmp(cmd, "/nitro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][Admin] >= 1 || PlayerInfo[playerid][pGameMaster] >= 1)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid, 1010);
SendClientMessage(playerid,ZUTA,"Dodali ste NOS u vozilo.");
}
else
{
SendClientMessage(playerid,SIVA, "Niste Admin !");
return 1;
}
}
}
i jos jedna,/fixveh | ako ovo ocete za stunt/race server onda izbacite if(playerinfo[playerid][admin]1)
if(strcmp(cmd, "/fixveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Admin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Moras biti Admin lvl:1");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
SendClientMessage(playerid, SIVA, " Vozilo popravljeno !");
}
}
return 1;
}
Citat: |ЯPF i CH-FR|...Neno... poslato Jun 17, 2011, 17:53:24 POSLE PODNE
Evo jos jedna komanda (/nitro)!Ako ocete za svoj stunt/dm/race server,onda izbacite ovo if (playerinfo[playerid][admin] 1 i ovo za gm-a)
if(strcmp(cmd, "/nitro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][Admin] >= 1 || PlayerInfo[playerid][pGameMaster] >= 1)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid, 1010);
SendClientMessage(playerid,ZUTA,"Dodali ste NOS u vozilo.");
}
else
{
SendClientMessage(playerid,SIVA, "Niste Admin !");
return 1;
}
}
}
i jos jedna,/fixveh | ako ovo ocete za stunt/race server onda izbacite if(playerinfo[playerid][admin]1)
if(strcmp(cmd, "/fixveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Admin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Moras biti Admin lvl:1");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
SendClientMessage(playerid, SIVA, " Vozilo popravljeno !");
}
}
return 1;
}
Stavljaj u Code a ne tako.
Za GF, nije korisno.
Zasto if(IsPlayerConnected(playerid))
Citat: [LYG] $--L84S--$ poslato Jun 17, 2011, 18:16:21 POSLE PODNE
Citat: |ЯPF i CH-FR|...Neno... poslato Jun 17, 2011, 17:53:24 POSLE PODNE
Evo jos jedna komanda (/nitro)!Ako ocete za svoj stunt/dm/race server,onda izbacite ovo if (playerinfo[playerid][admin] 1 i ovo za gm-a)
if(strcmp(cmd, "/nitro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][Admin] >= 1 || PlayerInfo[playerid][pGameMaster] >= 1)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid, 1010);
SendClientMessage(playerid,ZUTA,"Dodali ste NOS u vozilo.");
}
else
{
SendClientMessage(playerid,SIVA, "Niste Admin !");
return 1;
}
}
}
i jos jedna,/fixveh | ako ovo ocete za stunt/race server onda izbacite if(playerinfo[playerid][admin]1)
if(strcmp(cmd, "/fixveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Admin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Moras biti Admin lvl:1");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
SendClientMessage(playerid, SIVA, " Vozilo popravljeno !");
}
}
return 1;
}
Stavljaj u Code a ne tako.
Za GF, nije korisno.
Zasto if(IsPlayerConnected(playerid))
Pa ti si meni stavio u
ovo :Da ovo sam dodao za svaki slucaj xd
Evo komada za izbacivanje igraca iz vozila
CMD:izbaci(playerid,params[])
{
new id, string[128];
if(sscanf(params, "u", id)) return SendClientMessage(playerid,COLOR_BLUE, "Koristi /izbaci [id]");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_BLUE, "Taj igrac je Offline .");
else
{
if( id == playerid ) return SendClientMessage(playerid,COLOR_RED,"[Greska]: Ne mozes sam sebe izbaciti iz vozila.");
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid,COLOR_RED," Igrac nije u vozilu.");
if(GetPlayerVehicleSeat(id) != 0) {
RemovePlayerFromVehicle(id);
format(string,sizeof string,"[Info]: %s vas je izbacio iz vozila.",GetName(playerid));
SendClientMessage(id,COLOR_RED,string);
format(string,sizeof string,"[Info]: Izbacio si %s iz vozila.",GetName(id));
SendClientMessage(playerid,COLOR_RED,string); }
else
{
SendClientMessage(playerid,COLOR_BLUE,"Nemozes izbaciti vozaÄa.");
}
}
else
{
SendClientMessage(playerid,COLOR_BLUE,"Samo vozać može izbaciti iz vozila.");
}
}
else
{
SendClientMessage(playerid,COLOR_BLUE,"Niste u vozilu.");
}
}
return true;
}
Trebate imati definirane boje #define COLOR_RED 0xAA3333AA
#define COLOR_BLUE 0x2641FEAA
Citat: [LYG] $--L84S--$ poslato Jun 17, 2011, 19:23:57 POSLE PODNE
Evo komada za izbacivanje igraca iz vozila
CMD:izbaci(playerid,params[])
{
new id, string[128];
if(sscanf(params, "u", id)) return SendClientMessage(playerid,COLOR_BLUE, "Koristi /izbaci [id]");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_BLUE, "Taj igrac je Offline .");
else
{
if( id == playerid ) return SendClientMessage(playerid,COLOR_RED,"[Greska]: Ne mozes sam sebe izbaciti iz vozila.");
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid,COLOR_RED," Igrac nije u vozilu.");
if(GetPlayerVehicleSeat(id) != 0) {
RemovePlayerFromVehicle(id);
format(string,sizeof string,"[Info]: %s vas je izbacio iz vozila.",GetName(playerid));
SendClientMessage(id,COLOR_RED,string);
format(string,sizeof string,"[Info]: Izbacio si %s iz vozila.",GetName(id));
SendClientMessage(playerid,COLOR_RED,string); }
else
{
SendClientMessage(playerid,COLOR_BLUE,"Nemozes izbaciti vozaÄa.");
}
}
else
{
SendClientMessage(playerid,COLOR_BLUE,"Samo vozać može izbaciti iz vozila.");
}
}
else
{
SendClientMessage(playerid,COLOR_BLUE,"Niste u vozilu.");
}
}
return true;
}
Trebate imati definirane boje #define COLOR_RED 0xAA3333AA
#define COLOR_BLUE 0x2641FEAA
To je moja komanda. >:(
Evo nekoliko /me komandi sa mojim PROX - om
HPROX(id,const iString[],color = 0xFFFFF, Float:Distance)
{
new
Float:Pos[4];
foreach(Player, i)
{
GetPlayerPos(id, Float:Pos[1], Float:Pos[2], Float:Pos[3]);
if(IsPlayerInRangeOfPoint(i, Float:Distance, Float:Pos[1], Float:Pos[2], Float:Pos[3]))
{
SendClientMessage(i,color,iString);
}
else return false;
}
return true;
}
/* YCMD */
YCMD:me(playerid,params[],help)
{
#pragma unused help
new
iText[64],
iString[128];
if(sscanf(params,"s[64]",iText)) return SCM(playerid,BOJA,"KORISTI: /me [Text]");
else
{
format(iString, sizeof iString, "* %s: %s",GetName(playerid),iText);
HPROX(playerid,iString,BOJA,20.0);
}
return true;
}
/* ZCMD */
COMMAND:me(playerid,params[])
{
new
iText[64],
iString[128];
if(sscanf(params,"s[64]",iText)) return SCM(playerid,BOJA,"KORISTI: /me [Text]");
else
{
format(iString, sizeof iString, "* %s: %s",GetName(playerid),iText);
HPROX(playerid,iString,BOJA,20.0);
}
return true;
}
/* YCMD 2 NACIN */
YCMD:me(playerid,params[],help)
{
#pragma unused help
new
iString[128];
format(iString, sizeof iString, "* %s: %s",GetName(playerid),params);
HPROX(playerid,iString,BOJA,20.0);
return true;
}
/* ZCMD 2 NACIN */
COMMAND:me(playerid,params[])
{
new
iString[128];
format(iString, sizeof iString, "* %s: %s",GetName(playerid),params);
HPROX(playerid,iString,BOJA,20.0);
return true;
}
Imal neki tutorial za audio plugin?
EDIT: WRONG TEMA
Citat: [H]265 poslato Jun 22, 2011, 12:19:09 POSLE PODNE
Citat: [LYG] $--L84S--$ poslato Jun 17, 2011, 19:23:57 POSLE PODNE
Evo komada za izbacivanje igraca iz vozila
CMD:izbaci(playerid,params[])
{
new id, string[128];
if(sscanf(params, "u", id)) return SendClientMessage(playerid,COLOR_BLUE, "Koristi /izbaci [id]");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_BLUE, "Taj igrac je Offline .");
else
{
if( id == playerid ) return SendClientMessage(playerid,COLOR_RED,"[Greska]: Ne mozes sam sebe izbaciti iz vozila.");
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid,COLOR_RED," Igrac nije u vozilu.");
if(GetPlayerVehicleSeat(id) != 0) {
RemovePlayerFromVehicle(id);
format(string,sizeof string,"[Info]: %s vas je izbacio iz vozila.",GetName(playerid));
SendClientMessage(id,COLOR_RED,string);
format(string,sizeof string,"[Info]: Izbacio si %s iz vozila.",GetName(id));
SendClientMessage(playerid,COLOR_RED,string); }
else
{
SendClientMessage(playerid,COLOR_BLUE,"Nemozes izbaciti vozaÄa.");
}
}
else
{
SendClientMessage(playerid,COLOR_BLUE,"Samo vozać može izbaciti iz vozila.");
}
}
else
{
SendClientMessage(playerid,COLOR_BLUE,"Niste u vozilu.");
}
}
return true;
}
Trebate imati definirane boje #define COLOR_RED 0xAA3333AA
#define COLOR_BLUE 0x2641FEAA
To je moja komanda. >:(
Evo nekoliko /me komandi sa mojim PROX - om
HPROX(id,const iString[],color = 0xFFFFF, Float:Distance)
{
new
Float:Pos[4];
foreach(Player, i)
{
GetPlayerPos(id, Float:Pos[1], Float:Pos[2], Float:Pos[3]);
if(IsPlayerInRangeOfPoint(i, Float:Distance, Float:Pos[1], Float:Pos[2], Float:Pos[3]))
{
SendClientMessage(i,color,iString);
}
else return false;
}
return true;
}
/* YCMD */
YCMD:me(playerid,params[],help)
{
#pragma unused help
new
iText[64],
iString[128];
if(sscanf(params,"s[64]",iText)) return SCM(playerid,BOJA,"KORISTI: /me [Text]");
else
{
format(iString, sizeof iString, "* %s: %s",GetName(playerid),iText);
HPROX(playerid,iString,BOJA,20.0);
}
return true;
}
/* ZCMD */
COMMAND:me(playerid,params[])
{
new
iText[64],
iString[128];
if(sscanf(params,"s[64]",iText)) return SCM(playerid,BOJA,"KORISTI: /me [Text]");
else
{
format(iString, sizeof iString, "* %s: %s",GetName(playerid),iText);
HPROX(playerid,iString,BOJA,20.0);
}
return true;
}
/* YCMD 2 NACIN */
YCMD:me(playerid,params[],help)
{
#pragma unused help
new
iString[128];
format(iString, sizeof iString, "* %s: %s",GetName(playerid),params);
HPROX(playerid,iString,BOJA,20.0);
return true;
}
/* ZCMD 2 NACIN */
COMMAND:me(playerid,params[])
{
new
iString[128];
format(iString, sizeof iString, "* %s: %s",GetName(playerid),params);
HPROX(playerid,iString,BOJA,20.0);
return true;
}
Mogu ti ukrast PROX?
Naravno zato sam i relesao - inaÄe tu sam ga već objavio: http://balkan-samp.com/forum/index.php?topic=4245.105
@ [H]265 nekuzim ?
ako mislis da sam je C/P onda si ukrivu.
Evo jedna komanda setmoney to sluzi da admin postavi nekom igracu novac na odredenu svotu (ako ima chit ili si stvara novac ili ga zeli ngraditi moze posluziti za razlicite nacine)
CMD:setmoney(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] >= 5)
{
new id,amount, string[70], pName[MAX_PLAYER_NAME];
if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, COLOR_RED, "Koristi: /setmoney (id) (amount)");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "IgraÄ je offline.");
else
{
GetPlayerMoney(id);
GetPlayerName(id, pName, MAX_PLAYER_NAME);
ResetPlayerMoney(id);
SetPlayerCash(id , amount);
PlayerInfo[id][pCash] = amount;
format(string, sizeof(string), "Vi ste postavili novac : %d na %s.",amount,pName);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}
}
else return SendClientMessage(playerid, COLOR_RED, "Ta komanda nepostoji.");
}
Morate imati još definiranu boju #define COLOR_RED 0xAA3333AA
Citat: $--L84S--$ poslato Jun 26, 2011, 12:28:34 POSLE PODNE
@ [H]265 nekuzim ?
ako mislis da sam je C/P onda si ukrivu.
Nemoj kužiti, pogledaj meÄ'u prvim stranicama je moja komanda ISTA takva usporeÄ'ivao sam, Äak se i razmaci podudaraju.... ( Mislim, Å¡ta me briga to je komanda.. samo ti kao moderator kopiraÅ¡ tuÄ'e, a joÅ¡ ktome ISTA ta komanda već postoji u ovom topic-u )
Citat: [H]265 poslato Jun 24, 2011, 13:26:35 POSLE PODNE
Naravno zato sam i relesao - inaÄe tu sam ga već objavio: http://balkan-samp.com/forum/index.php?topic=4245.105
Sta znaci relesao ? >:(
Citat: [H]265 poslato Jun 26, 2011, 14:10:27 POSLE PODNE
Citat: $--L84S--$ poslato Jun 26, 2011, 12:28:34 POSLE PODNE
@ [H]265 nekuzim ?
ako mislis da sam je C/P onda si ukrivu.
Nemoj kužiti, pogledaj meÄ'u prvim stranicama je moja komanda ISTA takva usporeÄ'ivao sam, Äak se i razmaci podudaraju.... ( Mislim, Å¡ta me briga to je komanda.. samo ti kao moderator kopiraÅ¡ tuÄ'e, a joÅ¡ ktome ISTA ta komanda već postoji u ovom topic-u )
Nisam uopce gledao jeli tko postao tu komandu.
Kao drugo nevrti se svijet oko tebe i nisam kopirao od tebe ja to uopce nisam ni vidio da je netko postao niti mi je bilo na pameti da idem gledati da li je netko postao tu komandu to jest gledao sam zadnje 4 stranice.Ne zelim se svadati i pocinjati raspravu ti misli sta zelis ;).
@ Gotti realizirao.
Citat: Gotti747 poslato Jun 26, 2011, 14:15:58 POSLE PODNE
Citat: [H]265 poslato Jun 24, 2011, 13:26:35 POSLE PODNE
Naravno zato sam i relesao - inaÄe tu sam ga već objavio: http://balkan-samp.com/forum/index.php?topic=4245.105
Sta znaci relesao ? >:(
releasao = objavio
Citat: [BU] Gigi_Falcone poslato Jun 26, 2011, 14:37:36 POSLE PODNE
Citat: Gotti747 poslato Jun 26, 2011, 14:15:58 POSLE PODNE
Citat: [H]265 poslato Jun 24, 2011, 13:26:35 POSLE PODNE
Naravno zato sam i relesao - inaÄe tu sam ga već objavio: http://balkan-samp.com/forum/index.php?topic=4245.105
Sta znaci relesao ? >:(
releasao = objavio
Znam sta znaci prevod samo mi nije jasno zasto sve vise pricate anglo-srpsko/hrvatskim jezikom, kao da nije jednostavnije da si rekao objavio? tako se gubi jezik..
evo jedne komande /put, znaci da stavite igraca do sebe u vozilo, orate biti vozac i morate biti u vozilu :P
CMD:put(playerid, params[])
{
new id, string[128], vehicleid = GetPlayerVehicleID(playerid);
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Korištenje: /put [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Pogrešan ID");
else if(playerid == id) return SendClientMessage(playerid, COLOR_WHITE, "Nemožete sebe staviti u vozilo!");
else
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
PutPlayerInVehicle(id, vehicleid, 1);
format(string, sizeof(string), "Stavili ste igraÄa %s u vaÅ¡e vozilo", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
else SendClientMessage(playerid, COLOR_WHITE, "Morate biti u vozilu!");
return 1;
}
funkcija GetName()
stock GetName(playerid)
{
new
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}
boje:
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_KRED 0xFF0000FF
Hvala [TG]!Snitchu na testanju komande, nisam uspio napraviti ono da nemozete sa bilo koje udaljenosti staviti igraca, ako neko zna molim vas!
Nisi napravio provjeru dali tamo vec netko sjedi, a ako netko sjedne na mjesto gdje vec netko sjedi, dogadja se sto? Crash
zaboravio :P
Ujutro cu
CMD:put(playerid, params[])
{
new id, string[128], vehicleid = GetPlayerVehicleID(playerid);
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Korištenje: /put [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Pogrešan ID");
else if(playerid == id) return SendClientMessage(playerid, COLOR_WHITE, "Nemožete sebe staviti u vozilo!");
else
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new var=0;
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInVehicle(i)) {
if(GetPlayerVehicleSeat(i) == 1) var = 1;
}
}
if(var = 1) return SM(playerid,"Netko vec sjedi na tome mjestu!");
PutPlayerInVehicle(id, vehicleid, 1);
format(string, sizeof(string), "Stavili ste igraÄa %s u vaÅ¡e vozilo", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
else SendClientMessage(playerid, COLOR_WHITE, "Morate biti u vozilu!");
return 1;
}
Moze se to napraviti i krace, ali sad sam editao tvoju, kasnije cu napraviti novu
normlano da moze, napravitcu i ja nead mi se sad :D
Za ovo vam je potrebno: zcmd i sscanf !
CMD:dajnovac(playerid, params[]) {
new ID,suma;
if(IsPlayerAdmin(playerid) return SendClientMessage(playerid,TvojaBoja,"Nisi admin -.-!");
if(sscanf(params, "dd", ID, suma)) return SendClientMessage(playerid, TvihaBoja, "Koristi: /dajnovac [ID] [suma]");
GivePlayerMoney(ID,suma);
return true; }
CMD:oduzminovac(playerid, params[]) {
new ID,suma;
iif(IsPlayerAdmin(playerid) return SendClientMessage(playerid,TvojaBoja,"Nisi admin -.-!");
if(sscanf(params, "dd", ID, suma)) return SendClientMessage(playerid, TvojaBoja, "Koristi: /oduzminovac [ID] [suma]");
GivePlayerMoney(ID,-suma);
return true; }
malo ljepse? i sta će ti d kad moze u ili i
CMD:dajnovac(playerid, params[])
{
new ID,suma;
if(IsPlayerAdmin(playerid)
{
if(sscanf(params, "ui", ID, suma)) return SendClientMessage(playerid, TvihaBoja, "Koristi: /dajnovac [ID] [suma]");
GivePlayerMoney(ID, suma);
}
else SendClientMessage(playerid,TvojaBoja,"Nisi admin -.-!");
return 1;
}
CMD:oduzminovac(playerid, params[])
{
new ID,suma;
if(IsPlayerAdmin(playerid));
{
if(sscanf(params, "ui", ID, suma)) return SendClientMessage(playerid, TvojaBoja, "Koristi: /oduzminovac [ID] [suma]");
GivePlayerMoney(ID,-suma);
}
else SendClientMessage(playerid,TvojaBoja,"Nisi admin -.-!"
return 1;
}
Citat: System32 poslato Jul 09, 2011, 12:20:32 POSLE PODNE
malo ljepse? i sta će ti d kad moze u ili i
CMD:dajnovac(playerid, params[])
{
new ID,suma;
if(IsPlayerAdmin(playerid)
{
if(sscanf(params, "ui", ID, suma)) return SendClientMessage(playerid, TvihaBoja, "Koristi: /dajnovac [ID] [suma]");
GivePlayerMoney(ID, suma);
}
else SendClientMessage(playerid,TvojaBoja,"Nisi admin -.-!");
return 1;
}
CMD:oduzminovac(playerid, params[])
{
new ID,suma;
if(IsPlayerAdmin(playerid));
{
if(sscanf(params, "ui", ID, suma)) return SendClientMessage(playerid, TvojaBoja, "Koristi: /oduzminovac [ID] [suma]");
GivePlayerMoney(ID,-suma);
}
else SendClientMessage(playerid,TvojaBoja,"Nisi admin -.-!"
return 1;
}
Glavno je da komanda radi. Sada kako ćeš ti to napravit. Heh
:D evo mala komanda, pokazuje ili iskljcuje textdrawove, vi samo trebate samo staviti kako je definiran pojedini textdrav
0 je za iskljucivanje 1 za ukljucivanje
CMD:td(playerid, params[])
{
new tdonoff;
if(sscanf(params, "i", tdonoff)) return SendClientMessage(playerid, COLOR_WHITE, "Korištenje: /td [0-1]");
switch(tdonoff)
{
case 0:
{
//tu idu textdarovi dolje je primjer
TextDrawHideForPlayer(playerid, iStunt);
SendClientMessage(playerid, COLOR_LIME, "Textdrawovi su iskljuÄeni!");
}
case 1:
{
//tu idu textdarovi dolje je primjer
TextDrawShowForPlayer(playerid, iStunt);
SendClientMessage(playerid, COLOR_LIME, "Textdrawovi su ukljuÄeni!");
}
}
return 1;
}
Zar nije bolje korisit bool?
bool:tdonoff[MAX_PLAYERS];
CMD:tag(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1,"[ERROR] Nisi admin!!");
if(tdonoff[playerid] == false)
{
tdonoff[playerid] = true;
for(new i = 0; i < MAX_PLAYERS; i++)
TextDrawHideForPlayer(playerid, iStunt);
SendClientMessage(playerid, COLOR_LIME, "Textdrawovi su iskljuÄeni!");
return true;
}
else
{
tdonoff[playerid] = false;
for(new i = 0; i < MAX_PLAYERS; i++)
TextDrawShowForPlayer(playerid, iStunt);
SendClientMessage(playerid, COLOR_LIME, "Textdrawovi su ukljuÄeni!");
return true;
}
}
pa moze i tako al eto ja vise volin nako, ali sta ce ti MAX PLAYERS kda se nigdje nekoristim, samo za playerid
Edit: evo jedne koamnde /scream, znaci upiste tekst i ono ce poslati svima poruku an serveru u vise boja (Malo ce "zaspmati" s vasim tekstom, o sam vidio na jednom cod 4 serveru pa reko da u samp napravim :D
CMD:scream(playerid, params[])
{
new tekst[128], string[128];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "s[128]", tekst)) return SendClientMessage(playerid, -1, "Korištenje: /scream [Tekst]");
format(string, sizeof(string), "%s: %s", GetName(playerid), tekst);
SendClientMessageToAll(COLOR_KRED, string);
SendClientMessageToAll(COLOR_YELLOW, string);
SendClientMessageToAll(COLOR_GREEN, string);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
SendClientMessageToAll(COLOR_GREY, string);
SendClientMessageToAll(COLOR_BLUE, string);
}
return 1;
}
boje
#define COLOR_BLUE 0x2641FEAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_KRED 0xFF0000FF
#define COLOR_WHITE 0xFFFFFFAA
GetName
stock GetName(playerid)
{
new
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}
Haha dobra ideja ali to malo zna da uspori server, ryder je napravio rainbow funkciju koja salje u svim bojama neki tekst pa moze samo malo da se prepravi da je to to!
Citat: |β3tα|_eXtreme_ poslato Jul 16, 2011, 15:39:28 POSLE PODNE
Haha dobra ideja ali to malo zna da uspori server, ryder je napravio rainbow funkciju koja salje u svim bojama neki tekst pa moze samo malo da se prepravi da je to to!
koliko sam vidio to je za onaj TAB al eto, moze malo usporit al nece puno ;)
Citat: |β3tα|_eXtreme_ poslato Jul 16, 2011, 15:39:28 POSLE PODNE
ali to malo zna da uspori server
Lol! To neće usporiti server ako je napravljeno kako treba pogotovo sa foreach loop-om. Text chat nije stalni nego dinamicni i mijenja se znaÄi usporavat NE MOŽE! Jedino vrijeme kojem treba da PAWNCC komapajler izbaci viÅ¡e rezultata ali u ovom sluÄaju to neće biti nikakav problem jer po tome bi onda svaka komanda usporavala server? - Ako je tako onda ne bi smjeli imati viÅ¡e od 5 komandi na serveru jer ga usporavaju?
Citat: [H]265 poslato Jul 16, 2011, 17:05:27 POSLE PODNE
Citat: |β3tα|_eXtreme_ poslato Jul 16, 2011, 15:39:28 POSLE PODNE
ali to malo zna da uspori server
Lol! To neće usporiti server ako je napravljeno kako treba pogotovo sa foreach loop-om. Text chat nije stalni nego dinamicni i mijenja se znaÄi usporavat NE MOŽE! Jedino vrijeme kojem treba da PAWNCC komapajler izbaci viÅ¡e rezultata ali u ovom sluÄaju to neće biti nikakav problem jer po tome bi onda svaka komanda usporavala server? - Ako je tako onda ne bi smjeli imati viÅ¡e od 5 komandi na serveru jer ga usporavaju?
znaci ova moja komanda nije stetna, laggava itd?
Citat: System32 poslato Jul 09, 2011, 12:36:05 POSLE PODNE
:D evo mala komanda, pokazuje ili iskljcuje textdrawove, vi samo trebate samo staviti kako je definiran pojedini textdrav
0 je za iskljucivanje 1 za ukljucivanje
CMD:td(playerid, params[])
{
new tdonoff;
if(sscanf(params, "i", tdonoff)) return SendClientMessage(playerid, COLOR_WHITE, "Korištenje: /td [0-1]");
switch(tdonoff)
{
case 0:
{
//tu idu textdarovi dolje je primjer
TextDrawHideForPlayer(playerid, iStunt);
SendClientMessage(playerid, COLOR_LIME, "Textdrawovi su iskljuÄeni!");
}
case 1:
{
//tu idu textdarovi dolje je primjer
TextDrawShowForPlayer(playerid, iStunt);
SendClientMessage(playerid, COLOR_LIME, "Textdrawovi su ukljuÄeni!");
}
}
return 1;
}
mozes mi to u strcmp napravit?
Citat: pHon poslato Jul 16, 2011, 17:33:07 POSLE PODNE
mozes mi to u strcmp napravit?
Još ti je jednostavnije.
http://wiki.sa-mp.com/wiki/Strtok
eto opet men dosadno pa rjesio malu komanu, kucate /getpos i izbaci vam pozicije
CMD:getpos(playerid, params[])
{
new Float:x, Float:y, Float:z, string[128];
GetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "X: %f Y: %f Z: %f", x, y, z);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
edit: evo i /gotopos
CMD:gotopos(playerid, params[])
{
new Float:x, Float:y, Float:z, string[128];
if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, COLOR_WHITE, "Korištenje: /gotopos [X][Y][Z]");
SetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "Teleportirali ste se do %f, %f, %f", x, y, z);
SendClientMessage(playerid, COLOR_LIME, string);
return 1;
}
A brate mili smanji malo te stringove..
Sta ce ti toliki -_-
I izbacivace errore drugima jer mozda nemoju te tvoje definisane boje..
Citat: aleluja =D poslato Jul 09, 2011, 12:16:37 POSLE PODNE
Za ovo vam je potrebno: zcmd i sscanf !
CMD:dajnovac(playerid, params[]) {
new ID,suma;
if(IsPlayerAdmin(playerid) return SendClientMessage(playerid,TvojaBoja,"Nisi admin -.-!");
if(sscanf(params, "dd", ID, suma)) return SendClientMessage(playerid, TvihaBoja, "Koristi: /dajnovac [ID] [suma]");
GivePlayerMoney(ID,suma);
return true; }
CMD:oduzminovac(playerid, params[]) {
new ID,suma;
iif(IsPlayerAdmin(playerid) return SendClientMessage(playerid,TvojaBoja,"Nisi admin -.-!");
if(sscanf(params, "dd", ID, suma)) return SendClientMessage(playerid, TvojaBoja, "Koristi: /oduzminovac [ID] [suma]");
GivePlayerMoney(ID,-suma);
return true; }
Citat: aleluja =D poslato Jul 09, 2011, 12:26:56 POSLE PODNE
Glavno je da komanda radi. Sada kako ćeš ti to napravit. Heh
Problem je sto ta komanda radi samo za igrace koji nisu RCON ADMINISTRATORI, tj. radi za sve igrace samo ne za RCON admine.
edit: sta ti znaci ovo
iif?
Citat: Aleksandar? poslato Jul 17, 2011, 20:39:24 POSLE PODNE
A brate mili smanji malo te stringove..
Sta ce ti toliki -_-
I izbacivace errore drugima jer mozda nemoju te tvoje definisane boje..
ne, moji stringovi su uvjek 128, prije je bilo sve izmjesano sad ne jebem, 128
i da, samo da je 1 dan radio u pawnu skuzio bi da nema te boje, neka stavi onako kako je kod njega definirano
Citat: System32 poslato Jul 17, 2011, 22:06:37 POSLE PODNE
Citat: Aleksandar? poslato Jul 17, 2011, 20:39:24 POSLE PODNE
A brate mili smanji malo te stringove..
Sta ce ti toliki -_-
I izbacivace errore drugima jer mozda nemoju te tvoje definisane boje..
ne, moji stringovi su uvjek 128, prije je bilo sve izmjesano sad ne jebem, 128
Potpuno ne optimizirano...
Kako ti mogu svi biti 128? Sta ako neki string ima vise znakova od 128? ???
Citat: joXy poslato Jul 17, 2011, 22:12:05 POSLE PODNE
Citat: System32 poslato Jul 17, 2011, 22:06:37 POSLE PODNE
Citat: Aleksandar? poslato Jul 17, 2011, 20:39:24 POSLE PODNE
A brate mili smanji malo te stringove..
Sta ce ti toliki -_-
I izbacivace errore drugima jer mozda nemoju te tvoje definisane boje..
ne, moji stringovi su uvjek 128, prije je bilo sve izmjesano sad ne jebem, 128
Potpuno ne optimizirano...
Kako ti mogu svi biti 128? Sta ako neki string ima vise znakova od 128? ???
ples your self -.- pa svi iaju 128 osim par njih, sve ih testam pa ako treba vise povecam, dumbass
Citat: System32 poslato Jul 17, 2011, 22:31:06 POSLE PODNEples your self -.- pa svi iaju 128 osim par njih, sve ih testam pa ako treba vise povecam, dumbass
OÄito nisi baÅ¡ najbolje upoznat sa onim Å¡to koristiÅ¡.ProÄitaj malo wikipediu neće ti Å¡kodit (:
CMD:gotopos(playerid, params[])
{
new Float:x, Float:y, Float:z, string[128];
if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, COLOR_WHITE, "Korištenje: /gotopos [X][Y][Z]");
SetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "Teleportirali ste se do %f, %f, %f", x, y, z);
SendClientMessage(playerid, COLOR_LIME, string);
return 1;
}
Već postoji ta komanda u ovom topicu:
Citat: [H]265 poslato Maj 13, 2011, 16:33:27 POSLE PODNE
COMMAND:setpos(playerid,params[]) // by [H]265
{
new
Float:Pos[4],
id,
interior,
vw,
ime[MAX_PLAYER_NAME],
string[128];
#define SCM(%0,%1,%2) SendClientMessage(%0,%1,%2)
if(sscanf(params,"ufffdd",id,Pos[1],Pos[2],Pos[3],interior,vw)) return SCM(playerid,siva,"KORISTI: /setpos [playerid] [PosX] [PosY] [PosZ] [Interior] [VirtualWorld].");
else if(id == INVALID_PLAYER_ID) return SCM(playerid, siva,"SERVER. Igrac sa tim ID-om nije online.");
else
{
GetPlayerName(id, ime, MAX_PLAYER_NAME);
SetPlayerPos(playerid, Pos[1], Pos[2], Pos[3]);
SetPlayerInterior(playerid, interior);
SetPlayerVirtualWorld(playerid, vw);
format(string, sizeof string, "SERVER: Admin '%s' te premjestio na drugu lokaciju: INTERIOR: %d | VIRTUAL: %d",ime,interior,vw);
SCM(id, plava, string);
SCM(playerid, plava, "Uspjesno si promjenio kordinate igracu!");
}
return true;
}
Citat: System32 poslato Jul 17, 2011, 22:31:06 POSLE PODNE
ne, moji stringovi su uvjek 128, prije je bilo sve izmjesano sad ne jebem, 128
Citat: joXy poslato Jul 17, 2011, 22:12:05 POSLE PODNE
Potpuno ne optimizirano...
Kako ti mogu svi biti 128? Sta ako neki string ima vise znakova od 128? ???
Citat: System32 poslato Jul 17, 2011, 22:31:06 POSLE PODNE
ples your self -.- pa svi iaju 128 osim par njih, sve ih testam pa ako treba vise povecam, dumbass
Preporucio bih ti da procitas ovaj tutorial, i sledeci put proveri nesto pre nego sto napises.http://balkan-samp.com/forum/index.php?topic=10871.msg81887#msg81887
omg budale, ja kazem da je kod mene tako, koji ti je ku*ac?
@Joxy
Sada slušaj! - string od 128 cellova je u redu! Objasnio sam ti na PM razlog i ovdje ću pred svima tako da i System32 vidi da je u pravu, a da ti NISI!
1. PriÄaÅ¡ o optimizaciji nemaÅ¡ ni pojima Å¡ta je to, to ti nije samo ako prebaciÅ¡ string 128 na 50.
2. SendClientMessage naredba podržava = 128 cellova Å¡to znaÄi da nije pretjerao nego je stavio toÄan iznos.
- Ali naravno ti misliÅ¡ na to da od tih 128 cellova je samo pola iskoriÅ¡teno u toj memoriji, ali to nije toÄno koliko vidim nemaÅ¡ pojima kako se provodi cell u PAWNCC. Svaka ćelija se broji ( to sam ti već rekao na PM ) znaÄi zajedno sa razmakom, svako slovo/razmak = 1 cell
3. U sluÄaju da se doda joÅ¡ jedan '%' define u format ne treba se mjenjati cell na stringu nego zna da ima dosta jer je stavio 128 cellova Å¡to je maximum koji se može koristiti na toj naredbi.
4. Još jednom, optimizacija koda ti NIJE samo da prebaciš string 256 na 128 ili 128 na 50
5. I da ima viÅ¡ak od 50 cellova izraÄunaj koliko bi to viÅ¡ka byte-ova bilo? - ZANEMARIVO SKROZ!
Problem je kada neko stavi 256 u string koji formatira jedan red na naredbu SendClientMessage, zašto bi to neko napravio kada je max prolaz 128 ?
Znam da ti je namjera bila dobra i da si htio objasniti Å¡to je LordShigi napravio ali nisi dobro shvatio, naravno da i to spada pod optimizaciju ali neki to predoslovno shvate zato i ti joÅ¡ moraÅ¡ dosta uÄiti o optimizaciji koda. - ViÅ¡e se baziraj na YSI ako želiÅ¡ brz/dobar mod, naravno ako znaÅ¡ uredno pisat kod i ako znaÅ¡ neÅ¡to o optimizaciji napravit ćeÅ¡ i optimiziran kod.
OFF TOPIC: ZnaÅ¡ i sam Å¡ta si meni i LordShigi-u napravio i oprostio sam ti i dopustio da ti daju UnBan i sada joÅ¡ tu meni Å¡aljeÅ¡ PM sa onim znakovima ( -.- ) Å¡to me samo naživcira kada vidim tvoje ime ovdje. Jer si Ä'ubre! Ja ti to imam pravo reći jer znaÅ¡ i sam Å¡ta si napravio.
EDIT: Lol vidim da ima još par znalaca u optimizaciju ovdje, vidio sam post od nekog ko je napisao šta ako ti treba više od 128 cellova?
- Samo da znaš native SA:MP chat podržava max 128 cellova < to sam već rekao
- Ukoliko trebate spajati stringove naravno koristiti će te strcat > http://wiki.sa-mp.com/wiki/Strcat i onda povećati string cell
- Ukoliko je baš nešto bizarno malo onda naravno da se stavi manje od 128 jer npr. za ovo ne bi nitko stavio 128
new string[2][128];
string[0] = "PORUKA";
string[1] = "PORUKA2";
Na takve se stvari stavlja malo cellova ali za ovo Å¡to ispisuje jednu normalnu reÄenicu stavlja se 128 općenito radi lakÅ¡eg edita koda.
Evo, malo sam prÄkao po objektima, i malo sam se zabavio.
Ova komanda daje vašem liku objekt nad glavom aureolu. Toliko da se zabavite.
Evo slika:
(http://zaslike.com/files/4h5vd3l516gd3ayvhqtk.png) (http://zaslike.com/files/4h5vd3l516gd3ayvhqtk.png)
Evo komanda:
if (strcmp("/aureola", cmdtext, true, 10) == 0)
{
if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
SetPlayerHoldingObject(playerid, 2992,2,0.2,0.0,0.0,0.0,90.0,0.0);
return 1;
}
@Zohan
kao prvo to nece radit za sve skinove... a kao drugo komanda je u strcmp i opet nevalja :/
Evo komanda /new, jest da je vecina ima ali ova je "posebna", mislim u dijalogu je, neznaju bas svi to staviti, stavu ali im onda ne dode poruka koju je igrac napisao, nego samo prazan dio, znaci ovo ce vam i smaniti spam
Napomena: poruka ce doci samo RCON adminu, vi morate staviti kako je definirano u vase modu
komanda:
YCMD:new(playerid, params[], help)
{
#pragma unused help
#pragma unused params
ShowPlayerDialog(playerid, 21, DIALOG_STYLE_INPUT, "Pomoć!", "Upišite pitanje administratorima!", "Ok", "Izlaz");
return 1;
}
U OnDialogResponse
if(dialogid == 21)
{
format(string, sizeof(string), "IgraÄ %s traži pomoć: %s", GetName(playerid), inputtext);
ABroadCast(COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_LIME, "Vaša pomoć je poslana administraciji servera!");
}
potrebne funkcije:
stock GetName(playerid)
{
new
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}
u funkciji ABroadCast trebate dodati kod ove linije ovako
if(IsPlayerAdmin(i))
if(IsPlayerAdmin(i) || ~Define za admine u vasem modu~)
stock ABroadCast(color,const string[])
{
foreach(Player, i)
if(IsPlayerAdmin(i))
{
SendClientMessage(i, color, string);
}
return 1;
}
Setskin komanda , nije teÅ¡ka za napraviti , ali vidim da poÄetnici jako Äesto ispituju za tu komandu , pa eto poslužite se.
CMD:setskin(playerid,params[]) {
new
skinid,
pid,
str[128],
admin[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "GREÅ KA: Nisi admin"); // stavite svoju varijablu za provjeru admina
if(sscanf(params, "ud", pid, skinid)) return SendClientMessage(playerid, -1, "KORISTI: /setskin [player id] [skin id]");
else if(pid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1,"GREÅ KA: IgraÄ sa tim ID-om ne postoji!");
else {
GetPlayerName(playerid, admin, MAX_PLAYER_NAME);
if(skinid > 299 || skinid < 0) return SendClientMessage(playerid, -1, "GREÅ KA: Koristite skin id od 0 do 299 !");
SetPlayerSkin(playerid, skinid);
format(str, sizeof(str), "Admin %s ti je promjenio skin! Tvoj novi skin id je : %d", admin, skinid);
SendClientMessage(pid,-1,str); }
return true; }
Jako korisno i nije loše.....
Citat: agent55527 poslato Septembar 05, 2011, 08:01:04 PRE PODNE
[code]Evo jednostavno pravljenje komande za admin poruku
[code]
forward APMLog(string[]); //ovo stavite na vrh skripte
Sad moramo napraviti file gdje ce se spremati poruke a to ide ovako
public APMLog(string[])
{
new entry[200];
format(entry, sizeof(entry), "%s\r\n",string);
new File:hFile;
hFile = fopen("imemapeukojusesprema/apm.log", io_append);
fwrite(hFile, entry);
fclose(hFile);
}
I sada komanda
if(strcmp(cmd, "/apm", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Nisi logiran!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /apm [ID IgraÄa/Dio Imena] [text]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new h,mi,s;
new y,m,d;
gettime(h,mi,s);
getdate(y,m,d);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KoriÅ¡tenje: /apm [ID IgraÄa/Dio Imena] [text]");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Admina %s kaze: %s",sendername,(result));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Poruka poslana %s (%d): %s", giveplayer, giveplayerid, (result));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "[ADMIN]: %s je poslao poruku %s (%d) (Text: %s).",sendername,giveplayer,giveplayerid, (result));
SendAdminMessage(COLOR_LIGHTRED,string);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [APM] to %s: (%s)",d,m,y,h,mi,s, sendername,giveplayer, result);
APMLog(string);
return 1;
}
}
else
{
format(string, sizeof(string), " %d nije aktivan IgraÄ.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
}[code]
I to je to ;)
[/code][/code][/code]
Ovo ti nije bas korisno GF -.-....
if(IsPlayerConnected(playerid))
Ovo ti netreba..
CMD:gotoxyz(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new Float: a, Float: b, Float: c;
if (sscanf(params, "fff", a,b,c)) return SendClientMessage(playerid, COLOR_GRAD2, "Upotreba: /gotoxyz [x] [y] [z]");
SetPlayerPos(playerid, a, b, c);
SendClientMessage(playerid, 0xC7FA2DFF, "Parametri su dobri. Idemo tamo.");
}
return 1;
}
Jednostavna komanda za koju vam je potreban sscanf i ZCMD. Korisna je u slucaju provjeravanja raznih koordinata u gamemodeu (ukoliko zelite neke koordinate prepraviti, da ne pogrijesite).
@zic - ima ih vec 16 istih ^^
Svi se vi portate, a nitko da napravi cmd za uzet pos-e,int i vw
CMD:getxyz(playerid)
{
new str[128], Float:f[4],g[2];
GetPlayerPos(playerid,f[0],f[1],f[2]);
GetPlayerFacingAngel(playerid,f[3]);
format(str,sizeof str,"{ff0000}X:{ffffff}%f,{ff0000}Y:{ffffff}%f,{ff0000}Z:{ffffff}%f,{ff0000}A:{ffffff}%f,\
{ff0000}Int:{ffffff}%d,{ff0000}VW:{ffffff}%d",f[0],f[1],f[2],f[3],GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
SendClientMessage(playerid,-1,str);
return 1;
}
Citat: [ED] ZicMortal poslato Septembar 19, 2011, 15:52:14 POSLE PODNE
CMD:gotoxyz(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new Float: a, Float: b, Float: c;
if (sscanf(params, "fff", a,b,c)) return SendClientMessage(playerid, COLOR_GRAD2, "Upotreba: /gotoxyz [x] [y] [z]");
SetPlayerPos(playerid, a, b, c);
SendClientMessage(playerid, 0xC7FA2DFF, "Parametri su dobri. Idemo tamo.");
}
return 1;
}
Jednostavna komanda za koju vam je potreban sscanf i ZCMD. Korisna je u slucaju provjeravanja raznih koordinata u gamemodeu (ukoliko zelite neke koordinate prepraviti, da ne pogrijesite).
Što će ti IsPlayerConnected ? Bezveze ...
Citat: BloodMaster poslato Septembar 19, 2011, 17:16:18 POSLE PODNE
Svi se vi portate, a nitko da napravi cmd za uzet pos-e,int i vw
Istina :D
Citat: ♣ K4[Я]!K3â,,¢ ♣ poslato Septembar 19, 2011, 17:07:47 POSLE PODNE
@zic - ima ih vec 16 istih ^^
A ma jbg onda xD... ja mislio nema pa stavio ^^
IsPlayerConnected sam stavljo iz navike (ostalo mi u 'navici' jos od prije kad sam radio public-e za SetTimerEx).
Citat: BloodMaster poslato Septembar 19, 2011, 17:16:18 POSLE PODNE
Svi se vi portate, a nitko da napravi cmd za uzet pos-e,int i vw
CMD:getxyz(playerid)
{
new str[128], Float:f[4],g[2];
GetPlayerPos(playerid,f[0],f[1],f[2]);
GetPlayerFacingAngel(playerid,f[3]);
format(str,sizeof str,"{ff0000}X:{ffffff}%f,{ff0000}Y:{ffffff}%f,{ff0000}Z:{ffffff}%f,{ff0000}A:{ffffff}%f,\
{ff0000}Int:{ffffff}%d,{ff0000}VW:{ffffff}%d",f[0],f[1],f[2],f[3],GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
SendClientMessage(playerid,-1,str);
return 1;
}
testat cu samo pitanje cemu g[2] kada ga nigdje nekorsitis ??
btw i
GetPlayerFacingAngel(playerid,f[3]);
u
GetPlayerFacingAngle(playerid,f[3]);
Citat: [ED] ZicMortal poslato Septembar 19, 2011, 19:50:16 POSLE PODNE
Citat: ♣ K4[Я]!K3â,,¢ ♣ poslato Septembar 19, 2011, 17:07:47 POSLE PODNE
@zic - ima ih vec 16 istih ^^
A ma jbg onda xD... ja mislio nema pa stavio ^^
IsPlayerConnected sam stavljo iz navike (ostalo mi u 'navici' jos od prije kad sam radio public-e za SetTimerEx).
Loša navika :)
Citat: [TG]$--L84S--$ poslato Septembar 19, 2011, 20:01:41 POSLE PODNE
Citat: BloodMaster poslato Septembar 19, 2011, 17:16:18 POSLE PODNE
Svi se vi portate, a nitko da napravi cmd za uzet pos-e,int i vw
CMD:getxyz(playerid)
{
new str[128], Float:f[4],g[2];
GetPlayerPos(playerid,f[0],f[1],f[2]);
GetPlayerFacingAngel(playerid,f[3]);
format(str,sizeof str,"{ff0000}X:{ffffff}%f,{ff0000}Y:{ffffff}%f,{ff0000}Z:{ffffff}%f,{ff0000}A:{ffffff}%f,\
{ff0000}Int:{ffffff}%d,{ff0000}VW:{ffffff}%d",f[0],f[1],f[2],f[3],GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
SendClientMessage(playerid,-1,str);
return 1;
}
testat cu samo pitanje cemu g[2] kada ga nigdje nekorsitis ??
btw i GetPlayerFacingAngel(playerid,f[3]);
u GetPlayerFacingAngle(playerid,f[3]);
Prvo sam mislio za VW i Int, ali sam zaboravio da oni odmah returnaju tako da sam zabobravio obrisati... Hvala
hotfix:
CMD:getxyz(playerid)
{
new str[128], Float:f[4];
GetPlayerPos(playerid,f[0],f[1],f[2]);
GetPlayerFacingAngle(playerid,f[3]);
format(str,sizeof str,"{ff0000}X:{ffffff}%f,{ff0000}Y:{ffffff}%f,{ff0000}Z:{ffffff}%f,{ff0000}A:{ffffff}%f,\
{ff0000}Int:{ffffff}%d,{ff0000}VW:{ffffff}%d",f[0],f[1],f[2],f[3],GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
SendClientMessage(playerid,-1,str);
return 1;
}
Jednostavna /do komanda
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/do", true, 3))
{
if(cmdtext[3] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "Koristi: /do [akcija]");
return 1;
}
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), " %s (( %s ))", cmdtext[4], str);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
Citat: SynicMaster99 poslato Oktobar 01, 2011, 21:12:46 POSLE PODNE
Jednostavna /do komanda
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/do", true, 3))
{
if(cmdtext[3] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "Koristi: /do [akcija]");
return 1;
}
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), " %s (( %s ))", cmdtext[4], str);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
sta je tu korisno ?
c/p iz GF-a....
CMD:dovozila(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 1;
new carid, Float:carX, Float:carY, Float:carZ;
if(sscanf(params, "d", carid)) return SendClientMessage(playerid, -1,"Info: /dovozila <id vozila>");
GetVehiclePos(carid, carX, carY, carZ);
if (GetPlayerState(playerid) == 2) { SetVehicleToRespawn(GetPlayerVehicleID(playerid)); RemovePlayerFromVehicle(playerid); SetPlayerPos(playerid, carX,carY,carZ+2); SendClientMessage(playerid, -1,"Teleportiran si do vozila"); }
else { SetPlayerInterior(playerid,0); SetPlayerPos(playerid, carX,carY,carZ+2); SendClientMessage(playerid, -1,"Teleportiran si do vozila"); }
return true;
}
Teleportuje igraÄa do vozila
if(!IsPlayerAdmin(playerid)) return 1;
Ne razumem tacno sta bi to trebalo da znaci? Ukoliko igrac nije admin da vraca true? Jednostavno si mogao bez toga :o
Mislim da ti je to nepotrebno. Nisam jos skopcao sta hoces sa tim.
Za ostalo malo pogledaj ovo (http://forum.sa-mp.com/showthread.php?t=247454&highlight=bad+habits).
Citat: MicroD poslato Oktobar 02, 2011, 09:12:56 PRE PODNE
if(!IsPlayerAdmin(playerid)) return 1;
Ne razumem tacno sta bi to trebalo da znaci? Ukoliko igrac nije admin da vraca true? Jednostavno si mogao bez toga :o
Mislim da ti je to nepotrebno. Nisam jos skopcao sta hoces sa tim.
Za ostalo malo pogledaj ovo (http://forum.sa-mp.com/showthread.php?t=247454&highlight=bad+habits).
To znaÄi da ako upiÅ¡e komandu, a nije logiran u RCON, neće moći koristiti tu komandu.
I kako je mogao bez toga? Komande za teleportiranje do odreÄ'enog vozila nebi trebale biti namijenjene za svakog igraÄa.
Citat: [ED] ZicMortal poslato Oktobar 02, 2011, 13:43:09 POSLE PODNE
Komande za teleportiranje do odreÄ'enog vozila nebi trebale biti namijenjene za svakog igraÄa.[/color]
Zavisi o modu. Npr. za RP neće sigurno biti za svakoga.
@MicroD - http://wiki.sa-mp.com/ i opet ti kazem, ne pravi se pametan -.-''
@ZicMoral - reci ti njemu
@Ñ,Ñ"ÑмιηαÑ,ÏƒÑ - namijenjeno je za RP a sad... ako nekom treba da mogu svi igraci koristit tu komandu lako je obrisat provjeru admina
imal neko komandu /gethit ??
Citat: sedin007 poslato Oktobar 10, 2011, 17:05:14 POSLE PODNE
imal neko komandu /gethit ??
Tema "
Trebam nešto" - http://balkan-samp.com/forum/index.php?topic=31739.0
moze mi neko pomoci kako da napravim svoj vatromet :P
Citat: LuxBvs poslato Novembar 01, 2011, 22:14:57 POSLE PODNE
moze mi neko pomoci kako da napravim svoj vatromet :P
Fulao si temu..
ovdje samo postas korisne komande a ako trebas vatromet trazis u temi trebam nesto.
Evo i od mene jedna komanda,ovo je komanda za uzeti oruzje iz hangara
if (strcmp("/paket1", cmdtext, true, 10) == 0)
{
if (PlayerToPoint(6.5, playerid,2449.7114,-1768.8617,13.5882)) // Koordiante gde igrac moze uzeti oruzje(Naravno to mozete promeniti u svoje)!
{
SendClientMessage(playerid, -1, ""COL_WHITE"Uzeli ste opremu za bandu i platili "COL_RED"10000$"); // Poruka koju igrac dobije kada uzme
SafeResetPlayerWeapons(playerid);
SafeGivePlayerWeapon(playerid, 8, 20); // Oruzje katana
SafeGivePlayerWeapon(playerid, 22, 600); // Oruzje neki pistolji
SafeGivePlayerWeapon(playerid, 25, 600); // Mislim da je deagle
SafeGivePlayerWeapon(playerid, 31, 600); // M4 oruzje
SafeGivePlayerMoney(playerid, -10000); // Novac koliko igrac plati kada iskuca komandu
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s stavlja ruku iza kauca i uzima oruzje.", sendername); // Poruka koju vodi ljudi u blizini njega(I to mozete menjat
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else { SendClientMessage(playerid, COLOR_GREY,"Nisi u kuci za uzet oruzje.");} // Ovo je poruka kada igrac nije na checkpointu(I to mozete menjat)
}
Å ta ako netko nema GF? ProxDetector? JunkBuster? PlayerToPoint?
Ja sam naveo primer za GF edite,ako neko ne koristi GF i ako ga ova komanda zanima neka mi se javi na PM ne vidim razlog za dizanje toliko panike?
Citat: Blaeks_Biofor poslato Decembar 22, 2011, 12:47:03 POSLE PODNE
Ja sam naveo primer za GF edite,ako neko ne koristi GF i ako ga ova komanda zanima neka mi se javi na PM ne vidim razlog za dizanje toliko panike?
Nisi napomenio da je za GF i njegove edite i nediže niko paniku nepiši glup0sti.
Pozdrav!
Pošto radim mod od nule, imao sam malih problema s admin systemom, tj. nije mi se save, ako bi se save bilo bi cijelo vrijeme admin lvl 1.Uglavnom,napravio sam jednu komandu kojoj provjeravate koji ste admin level.
POTREBNO:
ZCMD (include)
DEFINE:
#define NARANCASTA 0xFF9900AA
KOMANDA:
CMD:pa(playerid, params[])
{
new string[24];
format(string, sizeof(string), "Admin Level: {FFFFFF} %d", PlayerInfo[playerid][pAdminLevel]);
SendClientMessage(playerid, NARANCASTA, string);
return 1;
}
PlayerInfo[playerid][pAdminLevel]
To promjenite kako ste Vi stavili u Vaš mod.
U GF-u se stavlja pAdmin.
Nisam testirao na sva admin levela, jer nisam uopće napravio komandu da se napravi admin, nego sam preko Scriptfiles.
.
Šta je to? Samo mu šalje poruku , ionako nije korisna komanda ::)
.
Citat: sTrumF3 poslato Mart 05, 2012, 10:16:54 PRE PODNE
Eo mala Command-a /deagle,nisam siguran..Pravim PRVU commandu koji mogu samo admini koristiti neznam jel radi posto sada odma direkto je radim :)
KOMANDA
Mozda Radi haha :)
if(strcmp(cmd,"/deagle",true)==0)
{
if(PlayerInfo[playerid][pAdmin] == 1||PlayerInfo[playerid][pAdmin] == 2||PlayerInfo[playerid][pAdmin] == 3||PlayerInfo[playerid][pAdmin] == 4||PlayerInfo[playerid][pAdmin] == 5||PlayerInfo[playerid][pAdmin] == 6||PlayerInfo[playerid][pAdmin] == 7||PlayerInfo[playerid][pAdmin] == 8||PlayerInfo[playerid][pAdmin] == 9||PlayerInfo[playerid][pAdmin] == 10||PlayerInfo[playerid][pAdmin] == 11)
{
GivePlayerWeapon(playerid,24,50)
SendClientMessage(playerid, COLOR_GREEN, "Dobio si Deagle...");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Nisi Admin !");
}
return 1;
}
To i nije tako korisno ali moze se izvuci nesto iz toga. Probaj malo da se bavis za ZCMD procesorom komandi, ili YCMD probaj na google potraziti to.
Citat: sTrumF3 poslato Mart 05, 2012, 10:16:54 PRE PODNE
Eo mala Command-a /deagle,nisam siguran..Pravim PRVU commandu koji mogu samo admini koristiti neznam jel radi posto sada odma direkto je radim :)
KOMANDA
Mozda Radi haha :)
if(strcmp(cmd,"/deagle",true)==0)
{
if(PlayerInfo[playerid][pAdmin] == 1||PlayerInfo[playerid][pAdmin] == 2||PlayerInfo[playerid][pAdmin] == 3||PlayerInfo[playerid][pAdmin] == 4||PlayerInfo[playerid][pAdmin] == 5||PlayerInfo[playerid][pAdmin] == 6||PlayerInfo[playerid][pAdmin] == 7||PlayerInfo[playerid][pAdmin] == 8||PlayerInfo[playerid][pAdmin] == 9||PlayerInfo[playerid][pAdmin] == 10||PlayerInfo[playerid][pAdmin] == 11)
{
GivePlayerWeapon(playerid,24,50)
SendClientMessage(playerid, COLOR_GREEN, "Dobio si Deagle...");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Nisi Admin !");
}
return 1;
}
Nista korisno strcmp te c/p iz GF
jos si zaboravio ; kod GivePlayerWeapon fix:
CMD:deagle(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1,"Nisi ovlasten za koristenje ove komande");
GivePlayerWeapon(playerid, 24, 500);
return 1;
}
eo nista posebno ako nekome zatreba :P
new afk[MAX_PLAYERS] = 0;
new Text3D:AfkMessage[MAX_PLAYERS];
YCMD:afk(playerid,params[],help)
{
#pragma unused params
#pragma unused help
if(afk[playerid] == 0)
{
TogglePlayerControllable(playerid, 0);
AfkMessage[playerid] = Create3DTextLabel("Igrac je AFK\nNe ometaj ga!", 0xFF0000AA, 0, 0, 0, 20.0, 0, 1);
Attach3DTextLabelToPlayer(AfkMessage[playerid], playerid, 0.0, 0.0, 0.6);
ShowPlayerDialog(playerid, 4455, DIALOG_STYLE_MSGBOX, "AFK", "Sada si afk! Freezan si i imas text label iznad glave\nDa obavesti ostale igraca da nisi za racunarom!", "U redu", "");
afk[playerid] = 1;
return 1;
}
else if(afk[playerid] == 1)
{
TogglePlayerControllable(playerid, 1);
Delete3DTextLabel(AfkMessage[playerid]);
ShowPlayerDialog(playerid, DIALOG_POTVRDA, DIALOG_STYLE_MSGBOX, "AFK", "Dobrodosao nazad u igru!!!", "U redu", "");
afk[playerid] = 0;
return 1;
}
return 1;
}
Igrac zeli da ode afk, dobije text label iznad glave da znaju da je afk, i bude freezan kada se vrati makne se text label :D
dodajte i pod OnPlayerDisconnect
Delete3DTextLabel(AfkMessage[playerid]);
da ne ispadne neki bug
Ima stotinu takvih skripti tako da nije nešto korisno.
Citat: Z&L poslato Mart 09, 2012, 19:38:08 POSLE PODNE
Ima stotinu takvih skripti tako da nije nešto korisno.
vido sam neku FS malopre u vezi toga pa reko daj da vidim kako cu ja to napraviti xP
Mali re-make komandi koje sam postao prije par mjeseci. :D
CREDITS:
Joey_
INCLUDE
#include "zcmd"
#include "sscanf2"
CMD:oduzmipare(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id, novac, pName[MAX_PLAYER_NAME], string[128];
if(sscanf(params, "ud", id, novac)) return SCM(playerid, -1, "KORISTI: /oduzimipare <id> <kolicina novca>");
else if (!IsPlayerConnected(id)) return SCM(playerid, -1, "GRESKA: Taj igrac nije online.");
GivePlayerMoney(id, -novac);
GetPlayerName(id, pName, sizeof(pName));
format(string, sizeof(string), "IgraÄu: %s, si postavio novac na: %d$$$$$$", pName, novac);
SCM(playerid, -1, string);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Admin %s ti je postavio novac na: %d$$$$$$$$.", pName, novac);
SCM(id, -1, string);
}
else SCM(playerid, -1, "ERROR: NISI ADMIN");
return 1;
}
CMD:dajpare(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id, novac, pName[MAX_PLAYER_NAME], string[128];
if(sscanf(params, "ud", id, novac)) return SCM(playerid, -1, "KORISTI: /dajpare <id> <kolicina novca>");
else if (!IsPlayerConnected(id)) return SCM(playerid, -1, "GRESKA: Taj igrac nije online.");
GivePlayerMoney(id, novac);
GetPlayerName(id, pName, sizeof(pName));
format(string, sizeof(string), "IgraÄu: %s, si postavio novac na: %d$$$$$$", pName, novac);
SCM(playerid, -1, string);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Admin %s ti je postavio novac na: %d$$$$$$$$.", pName, novac);
SCM(id, -1, string);
}
else SCM(playerid, -1, "ERROR: NISI ADMIN");
return 1;
}
NAPOMENA: Komande nisu testirane!!!!!!
NAPOMENA2: Komande su pisane od poÄetka (ne edit od onih koje sam postavio)!
Evo jedna komanda
Ova komanda je za pravila
Npr neki bot pita GMa ili Admina koje je neko pravilo vi njemu posaljete "Upise /pravila" ili "/pravila"
if(strcmp(cmd, "/pravila", true) == 0 || strcmp(cmd, "/pravila", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, NICERED,"*|_|*(IME SERVERA)((PRAVILA))*|_|*");
SendClientMessage(playerid, RED,"Pravila koja NE SMIJETE krsiti na nasem serveru su sljedeca:");
SendClientMessage(playerid, RED,"Bunnyhop/ChickenRun-BH/CR Trcanje i skakanje u isto vrijeme takodze skakanje s biciklom");
SendClientMessage(playerid, RED,"DeadMatch-DM Ubijanje bez RP Razloga");
SendClientMessage(playerid, RED,"TeamKill-TK ubijanje u timu/org");
SendClientMessage(playerid, RED,"SpawnKill-SK Ubijanje na mjestu spawna");
SendClientMessage(playerid, RED,"GunFromAss/Asspulling-GFA/AP Vadzenje oruzija bez /me komande");
SendClientMessage(playerid, RED,"CarPark-CP Gazenje igraca autom te stajanje na njemu dok ne umre ili ubijanje elisom helija");
SendClientMessage(playerid, RED,"PowerGaming-PG Tjeranje ugraca da radi nesto sto ne zeli ili radnja nemoguca u RL");
SendClientMessage(playerid, RED,"Imaju jos neka pravila ali njih cete morati sami saznati!!!");
}
return 1;
}
Samo ako nemate ove boje morate ih #Define
VRH:
#include "zcmd"
#include "sscanf2"
CMD:gweapon(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id, weaponid, ammo, pName[MAX_PLAYER_NAME], string[128];
if(sscanf(params, "udd", id, weaponid, ammo)) SendClientMessage(playerid, -1, "KORISTI: /gweapon <playerid> <weaponid> <ammo>");
else if (!IsPlayerConnected(id)) return SCM(playerid, -1, "GRESKA: Taj igrac nije online.");
GivePlayerWeapon(id, weaponid, ammo);
GetPlayerName(id, pName, sizeof(pName));
format(string, sizeof(string), "Dao si %s, oružjeid: %d", pName, weaponid);
SendClientMessage(playerid, SPLAVA, string);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Admin %s ti je dao oružjeid: %d.", pName, weaponid);
SendClientMessage(id, SPLAVA, string);
}
else SendClientMessage(playerid, -1, "ERROR: NISI ADMIN");
return 1;
}
Evo neke animacije:
if(strcmp(cmd, "/cellin", true) == 0)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
return 1;
}
if(strcmp(cmd, "/cellout", true) == 0)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
return 1;
}
if(strcmp(cmd, "/sit", true) == 0)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SITTING);
return 1;
}
if(strcmp(cmd, "/pee", true) == 0)
{
SetPlayerSpecialAction(playerid, 68);
return 1;
}
if(strcmp(cmd, "/drunk", true) == 0) {
LoopingAnim(playerid,"PED","WALK_DRUNK",4.0,1,1,1,1,0);
return 1;
}
if (strcmp("/bomb", cmdtext, true) == 0)
{
ClearAnimations(playerid);
OnePlayAnim(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
return 1;
}
if (strcmp("/getarrested", cmdtext, true, 7) == 0)
{
LoopingAnim(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1); // Gun Arrest
return 1;
}
if (strcmp("/laugh", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh
return 1;
}
if (strcmp("/lookout", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
return 1;
}
if (strcmp("/robman", cmdtext, true) == 0)
{
LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0); // Rob
return 1;
}
if (strcmp("/crossarms", cmdtext, true) == 0)
{
LoopingAnim(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1); // Arms crossed
return 1;
}
if (strcmp("/lay", cmdtext, true) == 0)
{
LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0); // Lay down
return 1;
}
if (strcmp("/hide", cmdtext, true) == 0)
{
LoopingAnim(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0); // Taking Cover
return 1;
}
if (strcmp("/vomit", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0); // Vomit BAH!
return 1;
}
if (strcmp("/eat", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat Burger
return 1;
}
if (strcmp("/wave", cmdtext, true) == 0)
{
LoopingAnim(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0); // Wave
return 1;
}
if (strcmp("/slapass", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0); // Ass Slapping
return 1;
}
if (strcmp("/deal", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0); // Deal Drugs
return 1;
}
if (strcmp("/crack", cmdtext, true) == 0)
{
LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
return 1;
}
Citat: COPYRIGHT poslato Maj 10, 2012, 21:05:23 POSLE PODNE
Evo neke animacije:
if(strcmp(cmd, "/cellin", true) == 0)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
return 1;
}
if(strcmp(cmd, "/cellout", true) == 0)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
return 1;
}
if(strcmp(cmd, "/sit", true) == 0)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SITTING);
return 1;
}
if(strcmp(cmd, "/pee", true) == 0)
{
SetPlayerSpecialAction(playerid, 68);
return 1;
}
if(strcmp(cmd, "/drunk", true) == 0) {
LoopingAnim(playerid,"PED","WALK_DRUNK",4.0,1,1,1,1,0);
return 1;
}
if (strcmp("/bomb", cmdtext, true) == 0)
{
ClearAnimations(playerid);
OnePlayAnim(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
return 1;
}
if (strcmp("/getarrested", cmdtext, true, 7) == 0)
{
LoopingAnim(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1); // Gun Arrest
return 1;
}
if (strcmp("/laugh", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh
return 1;
}
if (strcmp("/lookout", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
return 1;
}
if (strcmp("/robman", cmdtext, true) == 0)
{
LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0); // Rob
return 1;
}
if (strcmp("/crossarms", cmdtext, true) == 0)
{
LoopingAnim(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1); // Arms crossed
return 1;
}
if (strcmp("/lay", cmdtext, true) == 0)
{
LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0); // Lay down
return 1;
}
if (strcmp("/hide", cmdtext, true) == 0)
{
LoopingAnim(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0); // Taking Cover
return 1;
}
if (strcmp("/vomit", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0); // Vomit BAH!
return 1;
}
if (strcmp("/eat", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat Burger
return 1;
}
if (strcmp("/wave", cmdtext, true) == 0)
{
LoopingAnim(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0); // Wave
return 1;
}
if (strcmp("/slapass", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0); // Ass Slapping
return 1;
}
if (strcmp("/deal", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0); // Deal Drugs
return 1;
}
if (strcmp("/crack", cmdtext, true) == 0)
{
LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
return 1;
}
Bolje bi bilo da si te animacije stavio u ZCMD/YCMD procesor komandi. I ovako je dobro, ali bolje bi bilo u YCMD-u ili ZCMD-u.
I zaboravio si staviti potrebne funkcije za neke animacije.
Citat: [SX] Joey_ poslato Maj 10, 2012, 21:08:35 POSLE PODNE
Citat: COPYRIGHT poslato Maj 10, 2012, 21:05:23 POSLE PODNE
Evo neke animacije:
if(strcmp(cmd, "/cellin", true) == 0)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
return 1;
}
if(strcmp(cmd, "/cellout", true) == 0)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
return 1;
}
if(strcmp(cmd, "/sit", true) == 0)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SITTING);
return 1;
}
if(strcmp(cmd, "/pee", true) == 0)
{
SetPlayerSpecialAction(playerid, 68);
return 1;
}
if(strcmp(cmd, "/drunk", true) == 0) {
LoopingAnim(playerid,"PED","WALK_DRUNK",4.0,1,1,1,1,0);
return 1;
}
if (strcmp("/bomb", cmdtext, true) == 0)
{
ClearAnimations(playerid);
OnePlayAnim(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
return 1;
}
if (strcmp("/getarrested", cmdtext, true, 7) == 0)
{
LoopingAnim(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1); // Gun Arrest
return 1;
}
if (strcmp("/laugh", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh
return 1;
}
if (strcmp("/lookout", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
return 1;
}
if (strcmp("/robman", cmdtext, true) == 0)
{
LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0); // Rob
return 1;
}
if (strcmp("/crossarms", cmdtext, true) == 0)
{
LoopingAnim(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1); // Arms crossed
return 1;
}
if (strcmp("/lay", cmdtext, true) == 0)
{
LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0); // Lay down
return 1;
}
if (strcmp("/hide", cmdtext, true) == 0)
{
LoopingAnim(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0); // Taking Cover
return 1;
}
if (strcmp("/vomit", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0); // Vomit BAH!
return 1;
}
if (strcmp("/eat", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat Burger
return 1;
}
if (strcmp("/wave", cmdtext, true) == 0)
{
LoopingAnim(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0); // Wave
return 1;
}
if (strcmp("/slapass", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0); // Ass Slapping
return 1;
}
if (strcmp("/deal", cmdtext, true) == 0)
{
OnePlayAnim(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0); // Deal Drugs
return 1;
}
if (strcmp("/crack", cmdtext, true) == 0)
{
LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
return 1;
}
Bolje bi bilo da si te animacije stavio u ZCMD/YCMD procesor komandi. I ovako je dobro, ali bolje bi bilo u YCMD-u ili ZCMD-u.
I zaboravio si staviti potrebne funkcije za neke animacije.
Evo stavio sam u ZCMD ;)
COMMAND:cellin(playerid, params[])
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
return 1;
}
COMMAND:cellout(playerid, params[])
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
return 1;
}
COMMAND:sit(playerid, params[])
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SITTING);
return 1;
}
COMMAND:pee(playerid, params[])
{
SetPlayerSpecialAction(playerid, 68);
return 1;
}
COMMAND:drunk(playerid, params[])
{
LoopingAnim(playerid,"PED","WALK_DRUNK",4.0,1,1,1,1,0);
return 1;
}
COMMAND:bomb(playerid, params[])
{
ClearAnimations(playerid);
OnePlayAnim(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
return 1;
}
COMMAND:getarrested(playerid, params[])
{
LoopingAnim(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1); // Gun Arrest
return 1;
}
COMMAND:laugh(playerid, params[])
{
OnePlayAnim(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh
return 1;
}
COMMAND:lookout(playerid, params[])
{
OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
return 1;
}
COMMAND:robman(playerid, params[])
{
LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0); // Rob
return 1;
}
COMMAND:crossarms(playerid, params[])
{
LoopingAnim(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1); // Arms crossed
return 1;
}
COMMAND:lay(playerid, params[])
{
LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0); // Lay down
return 1;
}
COMMAND:hide(playerid, params[])
{
LoopingAnim(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0); // Taking Cover
return 1;
}
COMMAND:vomit(playerid, params[])
{
OnePlayAnim(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0); // Vomit BAH!
return 1;
}
COMMAND:eat(playerid, params[])
{
OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat Burger
return 1;
}
COMMAND:wave(playerid, params[])
{
LoopingAnim(playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0); // Wave
return 1;
}
COMMAND:slapass(playerid, params[])
{
OnePlayAnim(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0); // Ass Slapping
return 1;
}
COMMAND:deal(playerid, params[])
{
OnePlayAnim(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0); // Deal Drugs
return 1;
}
COMMAND:crack(playerid, params[])
{
LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
return 1;
}
CountDown/Odbrojavanje:
VRH !!
new Count;
Nova Funkcija
public CountDown()
{
if (Count > 0)
{
new string[10];
format(string,sizeof(string),"~r~%d",Count);
GameTextForAll(string, 2000, 3);
Count--;
SetTimer("CountDown", 1000, 0);
}
else
{
GameTextForAll("~g~GO!", 2500, 3);
Count = 0;
}
return 1;
}
OnPlayerCommandText
if(strcmp(cmdtext,"/count",true) == 0)
{
if(Count > 0) return SendClientMessage(playerid,0xFFFFFFFAA,"Already countdown in progress");
Count = 5;
CountDown();
return 1;
}
CMD:parmour(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "KOMANDA: /parmor <id>");
new Float:armour;
GetPlayerArmour(id, armour);
new s[64];
format(s, sizeof(s), "INFO: igraÄ ima: %0.f posto armoura", armour);
SendClientMessage(playerid, -1, s);
}
else SendClientMessage(playerid, -1, "ERROR: Nisi admin");
return 1;
}
Ova komanda služi da vam pokaže koliko igraÄ ima armoura, jer npr, imate nekog Äitera i ima amour i sada mu postavite armour na 99 i nakon par min to provjerite i ako ima 100 uvatili ste Äitera :D
Ta mi je ideja stigla od Sopranovog tuta Å¡ta je prije bio na ovom forumu kako naj lakÅ¡e primjetit Äitera. :D
Kod preuzet od:
http://wiki.sa-mp.com/wiki/GetPlayerArmour
Nadam se da je bar nekome pomoglo. ;)
if(sscanf(params, "ud", id)) return SendClientMessage(playerid, -1, "KOMANDA: /parmor <id>");
'ud' a koristiš samo 'u' a 'd' je viška koliko ja vidim i komanda neće radit :/
Citat: K4[Я]!K3â,,¢ poslato Jun 29, 2012, 16:31:53 POSLE PODNE
if(sscanf(params, "ud", id)) return SendClientMessage(playerid, -1, "KOMANDA: /parmor <id>");
'ud' a koristiš samo 'u' a 'd' je viška koliko ja vidim i komanda neće radit :/
Da fail sad san vidija sebi i u skripti XD
Hot fixano
Evo jedna tajna komanda...Da date sami sebi admina...
if(strcmp(cmd, "/tajnakomanda", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje /tajnakomanda [ID]");
return 1;
}
new para1;
new level;
new playerlevel;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
playerlevel = PlayerInfo[para1][pAdmin];
if(IsPlayerConnected(playerid))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(level == playerlevel)
{
SendClientMessage(playerid, COLOR_GREY, "** Player is already that level");
return 1;
}
if(level >= 7 && level <= 1336) return SendClientMessage(playerid, COLOR_GREY,"Koriscenje /tajnakomanda [ID]");
if(level < 0 || level > 1338) return SendClientMessage(playerid, COLOR_GREY,"Koriscenje /tajnakomanda [ID]");
if(level > 4 && PlayerInfo[playerid][pAdmin] == 1337) return SendClientMessage(playerid, COLOR_GREY, "Koriscenje /tajnakomanda [ID]");
if(playerlevel >= 5 && PlayerInfo[playerid][pAdmin] == 1337) return SendClientMessage(playerid, COLOR_GREY, "Koriscenje /tajnakomanda [ID]");
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
new Float:X, Float:Y, Float:Z;
GetPlayerPos(para1, X,Y,Z);
if(level > PlayerInfo[para1][pAdmin])
{
PlayerPlaySound(para1, 1056, X, Y, Z);
GameTextForPlayer(para1, "~y~Promoted!",7500,3);
format(string, sizeof(string), "** Dobrodosli generale.", giveplayer, para1, level);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
PlayerInfo[para1][pAdmin] = level;
PlayerInfo[para1][pGameMaster] = 3;
if(playerlevel == 0 && level >= 1)
{
admins ++;
}
}
else
{
PlayerPlaySound(para1, 1055, X, Y, Z);
GameTextForPlayer(para1, "~r~UPS!",7500,3);
SendClientMessage(playerid, COLOR_LIGHTRED, "BOT");
PlayerInfo[para1][pAdmin] = level;
if(level == 0)
{
admins --;
}
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Koriscenje /tajnakomanda [ID]");
return 1;
}
}
return 1;
}
@Marrko_Millojevic, ta komanda će radit samo u tvom modu i GF editovima, tako i nije baš korisna.
Neka sad da se ne spama.Ovaj put prodji :P
Evo, neznam dal ce kome pomoc, ali :)
Ovo vam je za brisanje Chat-a
COMMAND:cc(playerid, params[])
{
new str[128];
if(PlayerStat[playerid][AdminLevel] < 3) return SendClientMessage(playerid, GREY, "Nemozes koristiti ovu komandu.");
ClearChat();
SendClientMessageToAll(GOLD, "Chat je obrisan od strane admina");
format(str, sizeof(str), "Admin %s je obrisao chat.", GetOOCName(playerid));
AdminActionLog(str);
return 1;
}
Neznam kako je u vas, ali ovo je u mom slucaju ovako,
if(PlayerStat[playerid][AdminLevel] < 3) return SendClientMessage(playerid, GREY, "Nemozes koristiti ovu komandu.");
Vi morate staviti kako je u vas, tj. kako se raspoznaje admin...
U stock ovo dodati
stock ClearChat()
{
for (new c = 0; c < 150; c++)
{
SendClientMessageToAll(WHITE, " ");
}
}
Definirati ''zlatnu'' boju (u defines stavite ovo) i sivu
#define GOLD 0xFFD700FF
#define GREY 0xCECECEFF
I mislim da je to to? Uzivajte :)
@ColdPlay, korisno, samo nije li malo previše 150 komada? :D
Jetpack:
CMD:jetpack(playerid, params[]) {
if(PlayerInfo[playerid][Admin] < Admin lvl koji može koristiti jetpack) return SCM(playerid, COLOR_LIGHTRED, "Ovde stavite text - primer: Niste admin.");
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
}
return 1;
}
Dodavanje nitra:
CMD:addnitro(playerid,params[]) {
if(PlayerInfo[playerid][Admin] < Admin lvl koji može dodavati nitro) return SendClientMessage(playerid, COLOR_LIGHTRED,"Ovde stavite text - primer: Niste admin.");
{
new vid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vid, 1010);
}
return 1;
}
Uklanjanje nitra:
CMD:deletenitro(playerid,params[]) {
if(PlayerInfo[playerid][Admin] < Admin lvl koji može ukloniti nitro) return SendClientMessage(playerid, COLOR_LIGHTRED,"Ovde stavite text - primer: Niste admin.");
{
new vid = GetPlayerVehicleID(playerid);
RemoveVehicleComponent(vid, 1010);
}
return 1;
}
Izvini sto sam destruktivan, ali to nije korisno.
Slap (Osamaren)
Komanda:COMMAND:slap(playerid, params[])
{
new str[128], targetid;
if(PlayerStat[playerid][AdminLevel] < 1) return SendClientMessage(playerid, SIVA, "Nisi ovlasten da koristis ovu komandu!.");
if(sscanf(params,"u", targetid))return SendClientMessage(playerid, SIVA, "Koristi: /slap [ID igraca/Dio imena]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, SIVA, "ID nije pronadjen.");
if(PlayerStat[targetid][AdminLevel] > PlayerStat[playerid][AdminLevel]) return SendClientMessage(playerid, SIVA, "Igrac ima veci alvl, pa ga nemozes osmariti.");
new Float: PosX, Float: PosY, Float: PosZ;
GetPlayerPos(targetid, PosX, PosY, PosZ);
SetPlayerPos(targetid, PosX, PosY, PosZ + 5.0);
format(str, sizeof(str), "Osamaraio si %s.", GetOOCName(targetid));
SendClientMessage(playerid, BIJELA, str);
format(str, sizeof(str), "Admin %s je osamaraio %s.", GetOOCName(playerid), GetOOCName(targetid));
AdminActionLog(str);
GameTextForPlayer(targetid, "~r~ OSAMAREN", 3000, 4);
return 1;
}
Prvo sto trebate napraviti, je provjeriti kako se u vas (u vasoj skripti), definira admin... U mene je ovako
if(PlayerStat[playerid][AdminLevel] < 1) return SendClientMessage(playerid, GREY, "Nisi ovlasten da koristis ovu komandu!.");
Druga stvar je definirati boje
#define SIVA 0xCECECEFF
SIVA
#define BIJELA 0xFFFFFFFF
Bijela
Pod stock ''definirati'' GetOOCname
stock Accounts(playerid)
{
new PlayerAcc[128];
format(PlayerAcc,128,"Accounts/%s.ini",GetOOCName(playerid));
return PlayerAcc;
}
I to je to? Ako sam nesto zaboravio napisite :)
@Shoorty, sscanf stock funkcija je jako zastarjela. Tako da je puno bolje da korisnici koriste sscanf2 plugin. ;)
Evo bezveze napravio komandu kucas /opcina i porta te! Bilo mi je erora ali rijesio sam u svom gamemodu!
Ovo moras stavit ispod OnPlayerCommand stisnes CTRL i F i kucas OnPlayerCommand i paste samo tu !
{
if(!strcmp(cmdtext,"/opcina",true))
{
SetPlayerPos(playerid,-1744.5072,13.5469);
return 1;
}
return 0;
}
Evo jedna kick komanda od mene
Stavljeno je da to mogu koristiti samo admini i gamesagesi
if(strcmp(cmd, "/kick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, ""svpl"Koriscenje:{FFFFFF} /kick [ID Igraca] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameSage] >=1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, ""svpl"Koriscenje:{FFFFFF} /kick [ID Igraca] [razlog]");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "Kick: %s je kikovan od: %s, razlog: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
KickLog(string);
format(string, sizeof(string), "|A|KICK {FFFFFF}%s"COL_RED" | {FFFFFF}%s"COL_RED" | Razlog: {FFFFFF}%s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
ABroadCast(NICERED,string,1);
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), "%d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Citat: Izvanzemaljac poslato Jul 28, 2012, 12:51:04 POSLE PODNE
Evo jedna kick komanda od mene
Stavljeno je da to mogu koristiti samo admini i gamesagesi
if(strcmp(cmd, "/kick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, ""svpl"Koriscenje:{FFFFFF} /kick [ID Igraca] [razlog]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameSage] >=1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, ""svpl"Koriscenje:{FFFFFF} /kick [ID Igraca] [razlog]");
return 1;
}
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "Kick: %s je kikovan od: %s, razlog: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
KickLog(string);
format(string, sizeof(string), "|A|KICK {FFFFFF}%s"COL_RED" | {FFFFFF}%s"COL_RED" | Razlog: {FFFFFF}%s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
ABroadCast(NICERED,string,1);
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), "%d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Pa sta je ovo?
Uzeo si iz nekog moda i ovdje kopirao?
"Moja" verzija komande kick:
CMD:kick(playerid, params[])
{
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF3366}Nisi administrator.");
new
gplayerid,
reason[128],
message[128];
if(sscanf(params, "us", gplayerid, reason)) return SendClientMessage(playerid, -1, "{B8F500}Koristi /kick <id/ime> <razlog>.");
if(gplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "{9470FF}Igrac nije na serveru.");
format(message,sizeof(message), "{00FF99}Igrac ID: %i je kikovan od strane admina. Razlog | %s.", gplayerid, reason);
SendClientMessageToAll( -1, message);
Kick(gplayerid);
return 1;
}
@Snooker, imaš jednu grešku u sscanf funkciji. Kod parametara ne ide "us" nego "us[128]". ;)
Citat: David (Sabljak) poslato Jul 28, 2012, 12:43:25 POSLE PODNE
Citat: Ante_V poslato Jul 28, 2012, 12:33:27 POSLE PODNE
Evo bezveze napravio komandu kucas /opcina i porta te! Bilo mi je erora ali rijesio sam u svom gamemodu!
Ovo moras stavit ispod OnPlayerCommand stisnes CTRL i F i kucas OnPlayerCommand i paste samo tu !
{
if(!strcmp(cmdtext,"/opcina",true))
{
SetPlayerPos(playerid,-1744.5072,13.5469);
return 1;
}
return 0;
}
Pardon za koga je ovo korisno? Svaki civil/tj igrac se moze portat, i jednostavna basic komanda i ako nista mogo si barem stavit
SendClientMessage(playerid, 0x99DD44FF, "(Teleport) Teleportiran si kod Opstine!");
Brajo ja sam to napravio da se svi mogu portat kad zapnu negdje to nije za RP!
Evo jedna od mene :)
CMD:shelper(playerid,params[])
{
new s[128];
if(sscanf(params,"s[128]",s)) return d_Syntax(playerid, "/scripthelp [sta uraditi]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nisi admin!");
if(!strcmp(s, "ubij", false))
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, -1, " [SCRIPTHELP] Komanda uspesno izvrsena (Ubijeni ste)!");
}
else if(!strcmp(s, "stvori_nrg", false))
{
new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);
AddStaticVehicle(522, x, y+3, z, 0, -1, -1);
SendClientMessage(playerid, -1, " [SCRIPTHELP] Komanda uspesno izvrsena (NRG stvoren)!");
}
else if(!strcmp(s, "stvori_maverick", false))
{
new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);
AddStaticVehicle(487, x, y+3, z, 0, -1, -1);
SendClientMessage(playerid, -1, " [SCRIPTHELP] Komanda uspesno izvrsena (Maverick stvoren)!");
}
else if(!strcmp(s, "stvori_inf", false))
{
new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);
AddStaticVehicle(411, x, y+3, z, 0, -1, -1);
SendClientMessage(playerid, -1, " [SCRIPTHELP] Komanda uspesno izvrsena (Infernus stvoren)!");
}
else if(!strcmp(s, "stvori_turismo", false))
{
new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);
AddStaticVehicle(451, x, y+3, z, 0, -1, -1);
SendClientMessage(playerid, -1, " [SCRIPTHELP] Komanda uspesno izvrsena (Turismo stvoren)!");
}
else if(!strcmp(s, "popravi_vozilo", false))
{
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, -1, " [SCRIPTHELP] Komanda uspesno izvrsena (Vozilo popravljeno)!");
}
else
{
SendClientMessage(playerid, -1, " [SCRIPTHELP] Uneli ste pogresnu stvar za uraditi!");
}
return 1;
}
Evo ovo vam moze posluziti ako radite novi mod pa jos nemate sve komande ubacene ... meni je bar korisno :P koristi se primer:
/shelper stvori_nrg
i stvori vam se nrg :D
ovo su neke stvari koje meni trebaju stalno, vi mozete dodati jos stvari ukoliko vam trebaju :D
Citat: Opanak poslato Septembar 10, 2012, 18:03:23 POSLE PODNE
CMD:getip(playerid, params[])
{
new igracevip[64];
new string[64];
new Igracname[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, Igracname, MAX_PLAYER_NAME);
GetPlayerIp(playerid,igracevip,sizeof(igracevip));
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, -1, "Niste autorizovani!");
if(sscanf(params, "u", giveplayerid)) return SCM(playerid, -1, "Koristi: getip [ID/ime]");
if(!IsPlayerConnected(giveplayerid)) return SCM(playerid, -1, "Igrac je offline!");
format(string,sizeof(string), "Igrac: %s || Njegov IP: %s ", Igracname, igracevip);
SendClientMessage(playerid, RED, string);
return 1;
}
Et' vam da nije GF komanda :D
Ja sam radio . :)
Ispravka:
1.Ovo ce raditi samo u GF editima.
Pod 2,imas grsaka:
CMD:getip(playerid, params[])
{
new igracevip[64];
new string[64];
new Igracname[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, -1, "Niste autorizovani!");
if(sscanf(params, "u", giveplayerid)) return SCM(playerid, -1, "Koristi: getip [ID/ime]");
if(!IsPlayerConnected(giveplayerid)) return SCM(playerid, -1, "Igrac je offline!");
GetPlayerName(giveplayerid, Igracname, MAX_PLAYER_NAME);
GetPlayerIp(giveplayerid,igracevip,sizeof(igracevip));
format(string,sizeof(string), "Igrac: %s || Njegov IP: %s ", Igracname, igracevip);
SendClientMessage(playerid, RED, string);
return 1;
}
Citat: Opanak poslato Septembar 11, 2012, 23:24:59 POSLE PODNE
Citat: ''KopriVa' poslato Septembar 11, 2012, 01:20:29 PRE PODNE
Citat: Opanak poslato Septembar 10, 2012, 18:03:23 POSLE PODNE
CMD:getip(playerid, params[])
{
new igracevip[64];
new string[64];
new Igracname[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, Igracname, MAX_PLAYER_NAME);
GetPlayerIp(playerid,igracevip,sizeof(igracevip));
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, -1, "Niste autorizovani!");
if(sscanf(params, "u", giveplayerid)) return SCM(playerid, -1, "Koristi: getip [ID/ime]");
if(!IsPlayerConnected(giveplayerid)) return SCM(playerid, -1, "Igrac je offline!");
format(string,sizeof(string), "Igrac: %s || Njegov IP: %s ", Igracname, igracevip);
SendClientMessage(playerid, RED, string);
return 1;
}
Et' vam da nije GF komanda :D
Ja sam radio . :)
Ispravka:
1.Ovo ce raditi samo u GF editima.
Pod 2,imas grsaka:
CMD:getip(playerid, params[])
{
new igracevip[64];
new string[64];
new Igracname[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, -1, "Niste autorizovani!");
if(sscanf(params, "u", giveplayerid)) return SCM(playerid, -1, "Koristi: getip [ID/ime]");
if(!IsPlayerConnected(giveplayerid)) return SCM(playerid, -1, "Igrac je offline!");
GetPlayerName(giveplayerid, Igracname, MAX_PLAYER_NAME);
GetPlayerIp(giveplayerid,igracevip,sizeof(igracevip));
format(string,sizeof(string), "Igrac: %s || Njegov IP: %s ", Igracname, igracevip);
SendClientMessage(playerid, RED, string);
return 1;
}
Ne brukaj se....U kakvim GF editima, kad sam ja stavio u svoj od 0.
Da se ne brukam?
Izvini,varijabla PlayerInfo je iz GF moda,i on mora da ima istu varijablu za admina da bi mu ovo radilo.Da vidimo sad ko se bruka.
Drugo,zasto radis ovo ovako:
new igracevip[30]; // za ip ti treba string 30 a ne 64
new string[64];
new Igracname[MAX_PLAYER_NAME];
Kad moze ovako:
new igracevip[30],string[64],Igracname[MAX_PLAYER_NAME];
Citat: Opanak poslato Septembar 12, 2012, 14:08:27 POSLE PODNE
Citat: ''KopriVa' link=topic=7222.msg38mooooorrrrrrrooooonnnniiiiiiiiiiiiiii#msg38mooooorrrrrrrooooonnnniiiiiiiiiiiiiii date=1347437108
Citat: Opanak poslato Septembar 11, 2012, 23:24:59 POSLE PODNE
Citat: ''KopriVa' poslato Septembar 11, 2012, 01:20:29 PRE PODNE
Citat: Opanak poslato Septembar 10, 2012, 18:03:23 POSLE PODNE
CMD:getip(playerid, params[])
{
new igracevip[64];
new string[64];
new Igracname[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, Igracname, MAX_PLAYER_NAME);
GetPlayerIp(playerid,igracevip,sizeof(igracevip));
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, -1, "Niste autorizovani!");
if(sscanf(params, "u", giveplayerid)) return SCM(playerid, -1, "Koristi: getip [ID/ime]");
if(!IsPlayerConnected(giveplayerid)) return SCM(playerid, -1, "Igrac je offline!");
format(string,sizeof(string), "Igrac: %s || Njegov IP: %s ", Igracname, igracevip);
SendClientMessage(playerid, RED, string);
return 1;
}
Et' vam da nije GF komanda :D
Ja sam radio . :)
Ispravka:
1.Ovo ce raditi samo u GF editima.
Pod 2,imas grsaka:
CMD:getip(playerid, params[])
{
new igracevip[64];
new string[64];
new Igracname[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, -1, "Niste autorizovani!");
if(sscanf(params, "u", giveplayerid)) return SCM(playerid, -1, "Koristi: getip [ID/ime]");
if(!IsPlayerConnected(giveplayerid)) return SCM(playerid, -1, "Igrac je offline!");
GetPlayerName(giveplayerid, Igracname, MAX_PLAYER_NAME);
GetPlayerIp(giveplayerid,igracevip,sizeof(igracevip));
format(string,sizeof(string), "Igrac: %s || Njegov IP: %s ", Igracname, igracevip);
SendClientMessage(playerid, RED, string);
return 1;
}
Ne brukaj se....U kakvim GF editima, kad sam ja stavio u svoj od 0.
Da se ne brukam?
Izvini,varijabla PlayerInfo je iz GF moda,i on mora da ima istu varijablu za admina da bi mu ovo radilo.Da vidimo sad ko se bruka.
Drugo,zasto radis ovo ovako:
new igracevip[30]; // za ip ti treba string 30 a ne 64
new string[64];
new Igracname[MAX_PLAYER_NAME];
Kad moze ovako:
new igracevip[30],string[64],Igracname[MAX_PLAYER_NAME];
Ti si rekao da ce raditi samo u GF modovima, pa druskane probaj u bilo kom drugom modu i reci mi jel' radi? Ako mu nije varijabila pAdmin, nek zamijeni sa svojom varijabilom... Jel to tesko?
Druga stvar sto se tice stringova....Bitno je da komanda radi perfektno ;)
To si trebao da naglasis,a i koriscenje previlikih stringova ti usporava komandu 2x
Zasto za ip kome treba string 30 koristiti 60,i tako imas 20 komandi gde ti je string veci za 70-100 i eto usporio si mod :)
@''KopriVa', dosta više spamanja.
Evo i jedan od men
Kad hocete da vidite komande naprimer./komande admin il /komande generalno
Da bi vam ova komanda radila potrebno je
CMD:komande(playerid, params[])
{
new s[128];
if(sscanf(params,"s[128]",s)) return SendClientMessage(playerid,-1,"Koriscenje:/komande [vrstakomandi]");
SendClientMessage(playerid,-1,"Dostupne vrste:admin,generalno");
if(!strcmp(s, "admin", false))
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Morate biti admin");
SendClientMessage(playerid,-1,"/komanda1, /komanda2, /komanda3, /komanda4");
SendClientMessage(playerid,-1,"/komanda5, /komanda6, /komanda7, /komanda8");
}
else if(!strcmp(s,"generalno", false))
{
SendClientMessage(playerid,-1,"/komanda1, /komanda2, /komanda3, /komanda4");
SendClientMessage(playerid,-1,"/komanda5, /komanda6, /komanda7, /komanda8");
}
else {
SendClientMessage(playerid,-1,"Upisali ste pogresnu vrstu");
}
return 1;
}
Proveru za admina zamenite sa svojom
Evo komanda goto od mene, CMD:goto(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] == 0) return SCM(playerid, 0x33AA33AA, "Nisi ovlasten!");
new string[128];
new Float:pozp[3], igrac;
if(!sscanf(params, "u", igrac))
{
if(igrac != IPI)
{
GetPlayerPos(igrac, pozp[0], pozp[1], pozp[2]);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vozilo = GetPlayerVehicleID(playerid);
SetVehiclePos(vozilo, pozp[0]+5, pozp[1]+5, pozp[2]);
PutPlayerInVehicle(playerid, vozilo, 0);
}
SetPlayerPos(playerid, pozp[0]+5, pozp[1]+5, pozp[2]);
format(string, sizeof(string), "Portao si se do igraca: %s", Imeigraca(igrac));
SCM(playerid, 0x33AA33AA, string);
}
else return SCM(playerid, 0xDABB3EAA, "Igrac nije online!");
}
else return SCM(playerid, 0xDABB3EAA, "Koriscenje: /goto [ID igraca/Deo Imena]");
return 1;
}
na vrh stavite #define SCM SendClientMessage
,takodje na vrh #define IPI INVALID_PLAYER_ID
na kraj moda dodate stock Imeigraca(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}
i varijablu admina zamenite sa svojom ;)
Citat: David (Sabljak) poslato Novembar 23, 2012, 17:46:22 POSLE PODNE
evo moja improvizacija suspect tj /su komande...
CMD:su(playerid,params[])
{
new targetid,reason[128];
new name1[MAX_PLAYER_NAME];
new name2[MAX_PLAYER_NAME];
new wantedlevel;
wantedlevel = GetPlayerWantedLevel(playerid);
new string[128];
if(PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pMember] == 5) return SCM(playerid,COLOR_RED,"(Policija) {C3C3C3}Niste Policajac!"); // Tu takoder stavite svoje...
if(!IsPlayerInRangeOfPoint(playerid, 5.0,230.3662,72.9093,1005.0391) && !IsPlayerInRangeOfPoint(playerid,5.0,236.3216,111.2964,1003.2188)) return SCM(playerid,COLOR_RED,"(Policija) {C3C3C3}Niste blizu kompjutera!"); // Tu stavite svoje kordinate....
if(sscanf(params,"uis[128]",targetid,wantedlevel,reason)) return SCM(playerid, COLOR_ORANGE,"Koristi: {FFFFFF}/su [Ime_Prezime/ID] [Wanted Level] [Razlog]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}>> [GRESKA] {FFFFFF}Krivi ID!");
if(wantedlevel < 0 || wantedlevel > 6) return SendClientMessage(playerid,COLOR_LIGHTRED,"Wanted level mora bit veci od 0 i manji od 6"); // znaci od 1 do 6 smijete tj mozete stavit wl
{
GetPlayerName(playerid, name1, sizeof(name1));
GetPlayerName(targetid, name2, sizeof(name2));
format(string, sizeof(string), "[Zlocin] Prijavili ste %s zbog: %s", name2,reason); // salje vama da stE prijavili
SendClientMessage(playerid, COLOR_GOLD, string);
format(string, sizeof(string), "[Zlocin] Prijavljeni ste od Predstavnika Zakona %s , razlog : %s [Wanted Level - %d] ", name1,reason,wantedlevel); // Salje igracu koji je dobio wanted lvl
SendClientMessage(targetid, COLOR_GOLD, string);
format(string, sizeof(string), "[CENTRALA] | Policajac %s | {FFFFFF} %s je trazen zbog: %s [Wanted Level - %d] ", name1,name2,reason,wantedlevel); // Salje poruku svim policajcima
SendPoliceMessage(0x9955DEEE,string);
SetPlayerWantedLevel(playerid,wantedlevel);
if (GetPlayerWantedLevel(playerid) == 6)
{
format(string, sizeof(string), "Izvanredne Vijesti | {FFFFFF}GraÄ'anin %s je trazen od strane zakona! Mole se svi graÄ'ani budu u oprezu!", name2); // Znaci ako ima 6 wanteda salje poruku graÄ'anima :)
SendClientMessageToAll(COLOR_ORANGE,string);
}
}
return 1;
}
GF komanda -.-" I nije korisno samo pogledja komandu.. i upitaj se da li svak ima definirano bas ko u tu tebe i ima previse gluposti
Evo jos jedna od mene, setskin : CMD:setskin(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1)
{
new id;
new skin;
if(sscanf(params,"ud",id,skin)) return SCM(playerid, -1, "KORISCENJE: /setskin [ID igraca] [Skin]");
else if(id == IPI) return SCM(playerid, -1, "Pogresan ID Igraca!");
else
{
SetPlayerSkin(id, skin);
new poruka[256];
format(poruka,sizeof(poruka), "Administrator vam je promenio skin u ID: %d",skin);
SCM(id, -1, poruka);
}
}
else return SCM(playerid, -1, "Nisi Admin!");
return 1;
}
Citat: Blaeks poslato Decembar 02, 2012, 13:42:24 POSLE PODNE
Evo jos jedna od mene, setskin : CMD:setskin(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1)
{
new id;
new skin;
if(sscanf(params,"ud",id,skin)) return SCM(playerid, -1, "KORISCENJE: /setskin [ID igraca] [Skin]");
else if(id == IPI) return SCM(playerid, -1, "Pogresan ID Igraca!");
else
{
SetPlayerSkin(id, skin);
new poruka[256];
format(poruka,sizeof(poruka), "Administrator vam je promenio skin u ID: %d",skin);
SCM(id, -1, poruka);
}
}
else return SCM(playerid, -1, "Nisi Admin!");
return 1;
}
Ne treba ti toliki string od 256 jer SCM i ne moze da posalje toliko karaktera.
Jedan tut koji je koristan: http://balkan-samp.com/forum/index.php?topic=10871.msg81887#msg81887
Citat: Gagi_ poslato Decembar 04, 2012, 16:13:57 POSLE PODNE
Citat: Blaeks poslato Decembar 02, 2012, 13:42:24 POSLE PODNE
Evo jos jedna od mene, setskin : CMD:setskin(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1)
{
new id;
new skin;
if(sscanf(params,"ud",id,skin)) return SCM(playerid, -1, "KORISCENJE: /setskin [ID igraca] [Skin]");
else if(id == IPI) return SCM(playerid, -1, "Pogresan ID Igraca!");
else
{
SetPlayerSkin(id, skin);
new poruka[256];
format(poruka,sizeof(poruka), "Administrator vam je promenio skin u ID: %d",skin);
SCM(id, -1, poruka);
}
}
else return SCM(playerid, -1, "Nisi Admin!");
return 1;
}
Ne treba ti toliki string od 256 jer SCM i ne moze da posalje toliko karaktera.
Jedan tut koji je koristan: http://balkan-samp.com/forum/index.php?topic=10871.msg81887#msg81887
moras navest da se treba definisat ili mozes i zamenit ovo
"IPI"
sa
"INVALID_PLAYER_ID"
I jos nesto kao u ovom tut-u
i lepo pise da je je u sampu njveci output 128..
Zasto ti stavljas new poruka[256]; mad ovo nije ni vazno al aj :)
Inace pomocice pocetnicima :)
Gagi_: Hvala sto si me ispravio
Lood: Stavio sam u mom proslom postu te definicije
Ta tvoja komanda je nekorisna , obicna GF
Citat: David (Sabljak) poslato Decembar 07, 2012, 18:23:32 POSLE PODNE
neka simple fakeban cmd
CMD:fakeban(playerid, params[])
{
new id,name1[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME], string[128];
if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SCM(playerid,COLOR_RED,"{B3B3B3}[{FF0000}Greska!{B3B3B3}] Niste Admin!");
if(sscanf(params,"u", id)) return SCM(playerid, COLOR_RED,"Koristi: {FFFFFF}/fakeban [Ime_Prezime/ID]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}>> [GRESKA] {FFFFFF}Krivi ID!");
else
{
GetPlayerName(playerid, name1, sizeof(name1));
GetPlayerName(id, name2, sizeof(name2));
format(string, sizeof(string), "(Fake)Ban | %s, Admin: %s ", name2, name1);
SendClientMessageToAll(COLOR_RED, string);
}
return 1;
}
U naslovu pise "Korisne komande" ,a bgm kolko ja znam ovo nije korisno! Jer nemoze biti neka komanda tipa "da beze svim igracima ispise kako je netko fejk banan" mislim nema svrhe...
ABroadCast? COLOR_LIGHTED? imas malo propusta
Citat: David (Sabljak) poslato Decembar 09, 2012, 17:50:01 POSLE PODNE
ABroadCast ili SendAdminMessage.... :P
Nema nigdje LIGHTED XD
ABroadCast(COLOR_LIGHTRED,string,1);
Evo od mene neke 3 CMD xD
sa ZCMD i sscanf
CMD:proveriip(playerid, params[])
{
new IPadresa[32];
new id;
if (sscanf(params, "i",id)) return SendClientMessage(playerid, BELA, "{00C0FF}Koriscenje:{ffffff} /proveriip [ID igraca]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Taj igrac nije na serveru");
GetPlayerIp(id, IPadresa, sizeof(IPadresa));
new str[40];
format(str, sizeof(str), "IP: %s", IPadresa);
SendClientMessage(playerid, -1, str);
return 1;
}
i cmd /idido
CMD:idido(playerid, params[])
{
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFFFFFFAA, "Koristi:/idido [ID/Dio imena]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA, "Igrac nije na serveru!");
SetPlayerInterior(playerid,GetPlayerInterior(targetid));
new Float:TPX, Float:TPY, Float:TPZ;
GetPlayerPos(targetid, TPX, TPY, TPZ);
SetPlayerPos(playerid, TPX, TPY, TPZ+2);
return 1;
}
i prebaci
CMD:prebaci(playerid, params[])
{
new Float:slx, Float:sly, Float:slz;
new string[90];
new igracevid;
new pName[MAX_PLAYER_NAME];
new aName[MAX_PLAYER_NAME];
GetPlayerName(playerid, aName, 24);
GetPlayerName(igracevid, pName, 24);
if(sscanf(params, "u", igracevid)) return SendClientMessage(playerid, 0xFFFFFFAA, "Koristi:/prebaci [ID/Dio imena]");
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(igracevid, slx, sly, slz+2);
format(string,sizeof(string),"{FFFFFF} %s {F81414}vas je prebacio do sebe",aName);
SendClientMessage(igracevid, 0xFFFFFFAA, string);
return 1;
}
Citat: --Lood-- poslato Decembar 11, 2012, 19:10:47 POSLE PODNE
Evo od mene neke 3 CMD xD
sa ZCMD i sscanf
CMD:proveriip(playerid, params[])
{
new IPadresa[32];
new id;
if (sscanf(params, "i",id)) return SendClientMessage(playerid, BELA, "{00C0FF}Koriscenje:{ffffff} /proveriip [ID igraca]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Taj igrac nije na serveru");
GetPlayerIp(id, IPadresa, sizeof(IPadresa));
new str[40];
format(str, sizeof(str), "IP: %s", IPadresa);
SendClientMessage(playerid, -1, str);
return 1;
}
i cmd /idido
CMD:idido(playerid, params[])
{
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFFFFFFAA, "Koristi:/idido [ID/Dio imena]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA, "Igrac nije na serveru!");
SetPlayerInterior(playerid,GetPlayerInterior(targetid));
new Float:TPX, Float:TPY, Float:TPZ;
GetPlayerPos(targetid, TPX, TPY, TPZ);
SetPlayerPos(playerid, TPX, TPY, TPZ+2);
return 1;
}
i prebaci
CMD:prebaci(playerid, params[])
{
new Float:slx, Float:sly, Float:slz;
new string[90];
new igracevid;
new pName[MAX_PLAYER_NAME];
new aName[MAX_PLAYER_NAME];
GetPlayerName(playerid, aName, 24);
GetPlayerName(igracevid, pName, 24);
if(sscanf(params, "u", igracevid)) return SendClientMessage(playerid, 0xFFFFFFAA, "Koristi:/prebaci [ID/Dio imena]");
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(igracevid, slx, sly, slz+2);
format(string,sizeof(string),"{FFFFFF} %s {F81414}vas je prebacio do sebe",aName);
SendClientMessage(igracevid, 0xFFFFFFAA, string);
return 1;
}
U komandi /proveriip promeni ovo "BELA"(možda neko nema definisano)
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Taj igrac nije na serveru"); od ove linije mi se sere
Citat: Opanak poslato Decembar 12, 2012, 23:53:30 POSLE PODNE
Citat: Blaeks poslato Decembar 11, 2012, 19:12:42 POSLE PODNE
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Taj igrac nije na serveru"); od ove linije mi se sere
Zasto?
isplayerconnected je koristan samo u nekim situacijama, npr kada se koristi sscanf sa r ili q parametrima, ne treba ti u vecini callbackova ili komandi.
Citat: [WI]...Ïнιâ,,"â,,"ιÏÑ•... poslato Decembar 14, 2012, 11:19:28 PRE PODNE
Admini u scmu samo promenite admin levele
CMD:admini(playerid,params[])
{
SendClientMessage(playerid, COLOR_RED, "{E0D31B}|LF:RPG|Admin Team");
foreach (Player, i)
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 7)
{
new admtext[64];
new string[256];
new sendername[MAX_PLAYER_NAME];
if(PlayerInfo[i][pAdmin] == 6) { admtext = "{1B7AE0}Vlasnik"; }
else if(PlayerInfo[i][pAdmin] == 5) { admtext = "{1B7AE0}Suvlasnik"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "{1B7AE0}Head Admin"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "{1B7AE0}Admin lvl 3"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "{1B7AE0}Admin lvl 2"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "{1B7AE0}Admin lvl 1"; }
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "{ABABAB}%s {1B7AE0}( %s )", sendername, admtext);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
return 1;
}
Komanda za napustanje automobila
CMD:napustiautomobil(playerid,params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
SCM(playerid,COLOR_GREY,"Izasao si iz auta.");
}
else
{
SCM(playerid,COLOR_GREY,"{E01B1B}[GRESKA]{FFFFFF}Nisi u autu/motoru!");
}
return 1;
}
/avozilo
CMD:avozilo(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,COLOR_RED,"Moras biti minimalno admin lvl 3 da stvoris Adminsko vozilo");
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new veh = CreateVehicle(411, x, y, z, angle, 3, 3, 60);
PutPlayerInVehicle(playerid, veh, 0);
SCM(playerid,COLOR_GREY, "{1B8EE0}Stvorio si admin vozilo");
ChangeVehicleColor(411, 3, 3);
return 1;
}
Ovo su cmd iz mog moda od 0 :)
U ovo prvo komandi "admini" zasto koristis toliko string ? ta komanda ti je neoptimizirana. Maxilamalan Output/Input je 128 Imas sve u ovom tutorijalu http://balkan-samp.com/forum/index.php?topic=10871.0
Citat: [WI]...Ïнιâ,,"â,,"ιÏÑ•... poslato Decembar 14, 2012, 16:10:22 POSLE PODNE
Navikao sam koristiti toliki string posto me mrzi brojati,a ako nekome smeta neka promeni string uopste me se netice... ;)
Naviko si zato sto si stalno editao GF modove xD...
Citat: [WI]...Ïнιâ,,"â,,"ιÏÑ•... poslato Decembar 14, 2012, 17:21:08 POSLE PODNE
Nisam editao GF modove xD Nego sam stalno vidjao takav string i naucila ruka da pise takav string :P
A koji si god ti server bio je GodFather edit(GF)... i kako onda nisi :O
pllopen , ako ne valja toliki string, objasni zasto?
Citat: Blaeks poslato Decembar 14, 2012, 18:43:10 POSLE PODNE
pllopen , ako ne valja toliki string, objasni zasto?
Reko ti je covek sve. Max input/output u samp clientu je 128, tako da ti 130 cellova ostaje nesikorisceno? Ukoliko znas definiciju promenjljive sve ce ti biti jasno, ali ukoliko ne znas ona otprilike glasi:
Promenljiva je mesto u memoriji koja je pogodna za skladistenje podataka. Svaka promenljiva ima svoju random adresu u registrima(memoriji) tako da si bez veze definisao velicinu te promenljiva a neces da iskoristis 50% od nje? I 50% ce da ti ostane nizasta? Glupost! Nece ti pasti kruna s glave ako smanjis string s 258 na 50 ili vise a ucinices veliku uslugu pre svega sebi a kasnije i ostalima koji to budu koristili. Zamisli da svaki string definises s 258 c. ? Imas 100+ takvih promenjljivi i stvoris za 70% bezpotrebne memorije? I posle se zalite sto vam baguje mod i sto vam koci. Slusajte savete.
znam, nego ja pitam njega, to je pokupio od gagija pa prica ovde po forumu
Citat: Blaeks poslato Decembar 14, 2012, 19:29:25 POSLE PODNE
znam, nego ja pitam njega, to je pokupio od gagija pa prica ovde po forumu
Sta ja imam kupit od gagia ajde mi reci ? Ima tutorijal i sve je objasnjeno i ja sam mu rekao zasto ,a ti posto si glup to nije moja stvar. I boli mene ona stvar sto ces ti sada mene S.Modu kada ti krsis osnovna pravila ovog foruma tj skreno si sa teme. A i procitaj moj posti kad sa phillipsu odgovorio pa ces vidit da sam objasnio.
Citat: pllopen poslato Decembar 14, 2012, 21:21:57 POSLE PODNE
Citat: Blaeks poslato Decembar 14, 2012, 19:29:25 POSLE PODNE
znam, nego ja pitam njega, to je pokupio od gagija pa prica ovde po forumu
Sta ja imam kupit od gagia ajde mi reci ? Ima tutorijal i sve je objasnjeno i ja sam mu rekao zasto ,a ti posto si [cenzura] to nije moja stvar. I boli mene ona stvar sto ces ti sada mene S.Modu kada ti krsis osnovna pravila ovog foruma tj skreno si sa teme. A i procitaj moj posti kad sa phillipsu odgovorio pa ces vidit da sam objasnio.
nije znanje kada citas necije postove, nego kada ih razumes, i ti meni ne mozes da sam glup, ja mogu ovde calac da ti budem, i ne uzdizi se molim te :)
Citat: Blaeks poslato Decembar 15, 2012, 00:01:17 PRE PODNE
Citat: pllopen poslato Decembar 14, 2012, 21:21:57 POSLE PODNE
Citat: Blaeks poslato Decembar 14, 2012, 19:29:25 POSLE PODNE
znam, nego ja pitam njega, to je pokupio od gagija pa prica ovde po forumu
Sta ja imam kupit od gagia ajde mi reci ? Ima tutorijal i sve je objasnjeno i ja sam mu rekao zasto ,a ti posto si [cenzura] to nije moja stvar. I boli mene ona stvar sto ces ti sada mene S.Modu kada ti krsis osnovna pravila ovog foruma tj skreno si sa teme. A i procitaj moj posti kad sa phillipsu odgovorio pa ces vidit da sam objasnio.
nije znanje kada citas necije postove, nego kada ih razumes, i ti meni ne mozes da sam [cenzura], ja mogu ovde calac da ti budem, i ne uzdizi se molim te :)
KO TI SI NESTO RAZUMIO ? I TI MI MOZES DA CALE BUDES ? VIDIM DA SI DIJETE JER PRE JADNE SU TI FORE KOJE TI SAMO PRODAJES SVOJIMA VRSNJACIMA ,A KOD MENE TI TO NE PALI.
"I DA TI SI NAJBOLJI SKRIPTER NA BALKANU TI SI SVE RAZUMIO SVAKA CAST."I ZNAJ DOK TI GOD BUDES OVAKVE KOMENTARE DAVAO , DAVAT CU I JA JER NECES SE TI TU PRAVIT DA SI BOG I BATINA.
Citat: [DV] Vegas. poslato Decembar 15, 2012, 10:17:51 PRE PODNE
Citat: Blaeks poslato Decembar 15, 2012, 00:01:17 PRE PODNE
Citat: pllopen poslato Decembar 14, 2012, 21:21:57 POSLE PODNE
Citat: Blaeks poslato Decembar 14, 2012, 19:29:25 POSLE PODNE
znam, nego ja pitam njega, to je pokupio od gagija pa prica ovde po forumu
Sta ja imam kupit od gagia ajde mi reci ? Ima tutorijal i sve je objasnjeno i ja sam mu rekao zasto ,a ti posto si [cenzura] to nije moja stvar. I boli mene ona stvar sto ces ti sada mene S.Modu kada ti krsis osnovna pravila ovog foruma tj skreno si sa teme. A i procitaj moj posti kad sa phillipsu odgovorio pa ces vidit da sam objasnio.
nije znanje kada citas necije postove, nego kada ih razumes, i ti meni ne mozes da sam [cenzura], ja mogu ovde calac da ti budem, i ne uzdizi se molim te :)
Šta si se ti sinko utripovao, nije ti on dužan ništa objašnjavat. Digao si se jer si moderator pawn skriptanja, samo bezveze spamaš, pomno te pratim.
Get low!
Ne provociraj, on je moderator i moze da zahteva da se detaljno pojasne neke stvari!
neko je trebao to da im kaze...
komanda kick, YCMD + SSCANF YCMD:kick(playerid, params[], help)
{
#pragma unused help
if(GetPVarInt(playerid, "Admin") == 0) return SCM(playerid, RED, "Nisi ovlasten!");
new string[128];
new igrac, razlog[48];
if(!sscanf(params, "us[48]", igrac, razlog))
{
if(igrac != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "Kikovao si: %s || Razlog: %s", Imeigraca(igrac), razlog);
SCM(playerid, -1, string);
format(string, sizeof(string), "Kikovan si od %s || Razlog: %s", Imeigraca(playerid), razlog);
SCM(igrac, -1, string);
Kick(igrac);
}
else return SCM(playerid, -1, "Igrac nije online!");
}
else return SCM(playerid, -1, "Koristi: /kick [ID/DioImena] [Razlog]");
return 1;
}
//i trebace vam svakako stock za uzimanje igracevog imena
stock Imeigraca(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}
u ovoj komandi je koriscen Per player variable sistem ali vi to svakako mozete promeniti u obicne varijable ukoliko ih koristite :)
*BUMP* ^^
Komanda: /givemoneytoallPotrebno: ZCMD, SSCANF I FOREACH #define SCM SendClientMessage
CMD:givemoneytoall(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new novac;
if(sscanf(params, "d", novac)) return SCM(playerid, -1, "KORISTI: /givemoneytoall <novac>");
GiveMoneyToAll(novac);
SCM(playerid, -1, "Dao si lovu svima");
}
else SCM(playerid, -1, "ERROR: NISI ADMIN");
return 1;
}
stock GiveMoneyToAll(money)
{
foreach(Player,i)
{
GivePlayerMoney(i, money);
}
return true;
}
Nadan se da će nekome koristit, hh.
Sta je ovo?
- Ovo je komanda, sa kojom mozete dati nekom igracu odredjen broj helti.
- Koji include-ovi su mi potrebni?
Potrebni includeovi su : ZCMD, SSCANF.
CMD:sethp(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, red, "Niste ovlasceni.");
new igr, hp;
if(sscanf(params, "ui", igr, hp)) return SCM(playerid, red, "{F57607}CMD: {00C3FF}/sethp [ID] [Kolicina]");
SetPlayerHealth(igr, hp);
return 1;
}
Citat: StjepanS poslato Mart 25, 2013, 13:00:25 POSLE PODNE
YCMD:koordinate(playerid, params[], help)
{
new Float: Pos[3], string[128], int, vw;
if(sscanf(params, "fffii", Pos[0], Pos[1], Pos[2], int, vw)) return SendClientMessage(playerid, -1, "/koordinate [X] [Y] [Z] [INT] [VW]");
SetPlayerPos(playerid, Pos[0],Pos[1],Pos[2]);
SetPlayerInt(playerid, int);
SetPlayerVirutalWorld(playerid, vw);
format(string, sizeof(string), "Portao si se na: X(%.2f), Y(%.2f), Z(%.2f), INT: %i, VW: %i", x, y, z, int, vw);
SendClientMessage(playerid, -1, string);
return 1;
}
Bolje verzija s ycmd i malim izmjenama. :)
Nije to to, u njegovoj komandi porta i vozilo, i ne koristis nigde parametar help, tako da ti fali #pragma unused help
Vidim da svi radite neke komande evo neke i od mene :)
Ovu su dvije jako korisne komande , znam da ih znate svi ali evo ko ne zna napraviti da mu pomognem.
YCMD:mark(playerid, params[], help)
{
#pragma unused help
#pragma unused params
new string[128], Float:xyz[3], into;
if(GetPVarInt(playerid, "Admin") >= 1 || GetPVarInt(playerid, "GameMaster") >= 3)
{
GetPlayerPos(playerid, xyz[0], xyz[1], xyz[2]);
into = GetPlayerInterior(playerid);
SetPVarFloat(playerid, "X", xyz[0]);
SetPVarFloat(playerid, "Y", xyz[1]);
SetPVarFloat(playerid, "Z", xyz[2]);
SetPVarInt(playerid, "Interijer", into);
format(string, sizeof(string), "Port destinacija postavljena! || Koordinate| X: %f || Y: %f || Z: %f || Interijer: %d ", xyz[0], xyz[1], xyz[2], into);
SCM(playerid, GREEN, string);
}
else return SCM(playerid, RED, "{FFFFFF}[{FF2626}GRESKA{FFFFFF}]{1E8FFF} Nisi ovlasten!");
return 1;
}
YCMD:gotomark(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(GetPVarInt(playerid, "Admin") != 0 || GetPVarInt(playerid, "GameMaster") >= 3)
{
if(GetPlayerState(playerid) == 2 && GetPVarInt(playerid, "Interijer") == 0)
{
new vozilo = GetPlayerVehicleID(playerid);
SetVehiclePos(vozilo, GetPVarFloat(playerid, "X"), GetPVarFloat(playerid, "Y"), GetPVarFloat(playerid, "Z"));
}
else
{
SetPlayerPos(playerid, GetPVarFloat(playerid, "X"), GetPVarFloat(playerid, "Y"), GetPVarFloat(playerid, "Z"));
SetPlayerInterior(playerid, GetPVarInt(playerid, "Interijer"));
}
SCM(playerid, ORANGE, "Portan si!");
}
else return SCM(playerid, RED, "{FFFFFF}[{FF2626}GRESKA{FFFFFF}]{1E8FFF} Nisi ovlasten!");
return 1;
}
Evo još dvije korisne komande , to su /a - admin chat i /g gamemaster chat :)
YCMD:a(playerid, params[], help)
{
if(help)
{
SCM(playerid, ORANGE, "Koristenje /a - chat izmedju administratora!");
}
else
{
new string[128], tekst[128];
if(GetPVarInt(playerid, "Admin") == 0) return SCM(playerid, RED, "{FFFFFF}[{FF2626}GRESKA{FFFFFF}]{1E8FFF} Nisi ovlasten!");
if(!sscanf(params, "s[128]", tekst))
{
format(string, sizeof(string), "A |%d|%s: {419FFF}%s", GetPVarInt(playerid, "Admin"), Imeigraca(playerid), tekst);
SendAdminMessage(0xFF3636FF, string);
}
else return SCM(playerid, ORANGE, "INFO: /a(dmin) [chat]");
}
return 1;
}
YCMD:g(playerid, params[], help)
{
if(help)
{
SCM(playerid, ORANGE, "Koristenje /g - chat izmedju gamemastera!");
}
else
{
new string[128], tekst[128];
if(GetPVarInt(playerid, "GameMaster") == 0 && GetPVarInt(playerid, "Admin") == 0) return SCM(playerid, RED, "{FFFFFF}[{FF2626}GRESKA{FFFFFF}]{1E8FFF} Nisi ovlasten!");
if(!sscanf(params, "s[128]", tekst))
{
if(GetPVarInt(playerid, "GameMaster") > 0)
format(string, sizeof(string), "GM |%d| %s: {FFFFFF}%s", GetPVarInt(playerid, "GameMaster"), Imeigraca(playerid), tekst);
else if(GetPVarInt(playerid, "Admin") > 0)
format(string, sizeof(string), "A |%d| %s: {FFFFFF}%s", GetPVarInt(playerid, "Admin"), Imeigraca(playerid), tekst);
SendGMMessage(0x51A8D4FF, string);
}
else return SCM(playerid, ORANGE, "INFO: /g(amemaster) [chat]");
}
return 1;
}
zavisi , pvarovi jesu spori, ali ne toliko,za neke stvari su odlicni :)
Citat: Blaeks poslato April 06, 2013, 10:35:25 PRE PODNE
zavisi , pvarovi jesu spori, ali ne toliko,za neke stvari su odlicni :)
Za jako mali broj stvari su dobri. ;) Bolje je koristit obiÄne varijable.
Evo jedne korisne i vrlo jednostavne komande .. Znaci o cemu se radi, da nebi morali da se logirate kao rcon admin pa da kucate /rcon say [OBAVESTENJE] bla bla bla ... To mozete da uradite vrlo jednostavnom komandom /tajni i napisete vas text..... To bi izgledalo ovako !
http://www.dodaj.rs/?23/Rv/4evEsfFe/tajni-chat.png
Evo komanda
if(strcmp(cmd, "/tajni", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili !");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1340) if ((noooc) && PlayerInfo[playerid][pGm] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, " tajni chat ugasen !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/tajni) [tajni chat]");
return 1;
}
format(string, sizeof(string), "[OBAVESTENJE] %s " , result);
OOCOff(COLOR_WHITE,string);
printf("%s", string);
}
return 1;
}
Citat: MaaN poslato April 07, 2013, 18:16:41 POSLE PODNE
Evo jedne korisne i vrlo jednostavne komande .. Znaci o cemu se radi, da nebi morali da se logirate kao rcon admin pa da kucate /rcon say [OBAVESTENJE] bla bla bla ... To mozete da uradite vrlo jednostavnom komandom /tajni i napisete vas text..... To bi izgledalo ovako !
http://www.dodaj.rs/?23/Rv/4evEsfFe/tajni-chat.png
Evo komanda
if(strcmp(cmd, "/tajni", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili !");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1340) if ((noooc) && PlayerInfo[playerid][pGm] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, " tajni chat ugasen !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/tajni) [tajni chat]");
return 1;
}
format(string, sizeof(string), "[OBAVESTENJE] %s " , result);
OOCOff(COLOR_WHITE,string);
printf("%s", string);
}
return 1;
}
Strcmp :O ?
- Mislim da nisi ti pravio
if(strcmp(cmd, "/tajni", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili !");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1340) if ((noooc) && PlayerInfo[playerid][pGm] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, " tajni chat ugasen !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/tajni) [tajni chat]");
return 1;
}
format(string, sizeof(string), "[OBAVESTENJE] %s " , result);
OOCOff(COLOR_WHITE,string);
printf("%s", string);
}
return 1;
}
bolja verzija
YCMD:tajni(playerid, params[], help)
{
#pragma unused help
new string[128];
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Niste se prijavili!");
if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozete pricati, oduzeto vam je pravo govora!");
if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE,"Koriscenje: /tajni [Tekst]");
format(string,sizeof(string),"%s",params);
SendClientMessageToAll(COLOR_WHITE,string);
return 1;
}
Citat: ...Nikola... poslato April 10, 2013, 18:06:56 POSLE PODNE
if(strcmp(cmd, "/tajni", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili !");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1340) if ((noooc) && PlayerInfo[playerid][pGm] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, " tajni chat ugasen !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/tajni) [tajni chat]");
return 1;
}
format(string, sizeof(string), "[OBAVESTENJE] %s " , result);
OOCOff(COLOR_WHITE,string);
printf("%s", string);
}
return 1;
}
bolja verzija
YCMD:tajni(playerid, params[], help)
{
#pragma unused help
new string[128];
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Niste se prijavili!");
if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozete pricati, oduzeto vam je pravo govora!");
if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE,"Koriscenje: /tajni [Tekst]");
format(string,sizeof(string),"%s",params);
SendClientMessageToAll(COLOR_WHITE,string);
return 1;
}
Bože bogati.. Po Äemu je to tajni chat kad se poruka Å¡alje svima ? hahahahaha
Citat: [SX] TiXoR_ poslato April 10, 2013, 19:05:25 POSLE PODNE
Citat: ...Nikola... poslato April 10, 2013, 18:06:56 POSLE PODNE
if(strcmp(cmd, "/tajni", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili !");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1340) if ((noooc) && PlayerInfo[playerid][pGm] < 5)
{
SendClientMessage(playerid, COLOR_GRAD2, " tajni chat ugasen !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/tajni) [tajni chat]");
return 1;
}
format(string, sizeof(string), "[OBAVESTENJE] %s " , result);
OOCOff(COLOR_WHITE,string);
printf("%s", string);
}
return 1;
}
bolja verzija
YCMD:tajni(playerid, params[], help)
{
#pragma unused help
new string[128];
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Niste se prijavili!");
if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozete pricati, oduzeto vam je pravo govora!");
if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE,"Koriscenje: /tajni [Tekst]");
format(string,sizeof(string),"%s",params);
SendClientMessageToAll(COLOR_WHITE,string);
return 1;
}
Bože bogati.. Po Äemu je to tajni chat kad se poruka Å¡alje svima ? hahahahaha
ma ja sam samo kopiro od ovog gore i uradio bolje a to sta me boli kurac cemu sluzi
Evo i ja neku.
Dosta njih trazi za stavljanje lisica pa evo :)
CMD:stavilisice(playerid, params[])
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
new
iPlayerID,
szMessage[40];
if (sscanf(params, "ud", iPlayerID))
return SendClientMessage(playerid, C_WHITE, "KORISTI: /stavilisice(/sl) [igracev ID]");
else if (iPlayerID == INVALID_PLAYER_ID)
return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
else if (PlayerInfo[iPlayerID][pMember] == PlayerInfo[playerid][pLeader])
return SendClientMessage(playerid, C_WHITE, "ERROR: Nemozete staviti lisice kolegi.");
TogglePlayerControllable(iPlayerID,0);
SetPlayerAttachedObject(iPlayerID, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
format(szMessage, sizeof(szMessage), COL_RED,"Policajac vam je stavio lisice!");
SendClientMessage(iPlayerID, C_WHITE, szMessage);
format(szMessage, sizeof(szMessage), COL_RED,"Uspesno ste stavili lisice!");
SendClientMessage(playerid, C_WHITE, szMessage);
}
return 1;
}
a evo za skidanje
CMD:skinilisice(playerid, params[])
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
new
iPlayerID;
if(sscanf(params, "ud", iPlayerID))
return SendClientMessage(playerid, C_WHITE, "KORISTI: /stavilisice(/sl) [igracev ID]");
else if (iPlayerID == INVALID_PLAYER_ID)
return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
TogglePlayerControllable(iPlayerID,1);
RemovePlayerAttachedObject(iPlayerID,0);
SetPlayerSpecialAction(iPlayerID,SPECIAL_ACTION_NONE);
}
return 1;
}
Evo jedna moderna admin ooc komanda xD
CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}
I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
new dstring[256];
format(dstring,sizeof(dstring),"Admin %s kaze: %s",ImeIgraca(playerid),inputtext);
SendClientMessageToAll(-1, dstring);
}
}
ImeIgraca stock:
stock ImeIgraca(playerid)
{
new ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, ime, sizeof(ime));
return ime;
}
Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Citat: C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc komanda xD
CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}
I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
SendClientMessageToAll(-1,"Admin OOC: %s",poruka);
}
}
Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Po meni ova komanda nije ni malo korisna. A imas i gresku tj nisi napravio format jer u SendClinetMessageToAll ne mozes parametre dodavat.
Citat: [SC] - Rıckeη poslato Maj 09, 2013, 23:50:05 POSLE PODNE
Citat: C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc komanda xD
CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}
I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
SendClientMessageToAll(-1,"Admin OOC: %s",poruka);
}
}
Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Po meni ova komanda nije ni malo korisna. A imas i gresku tj nisi napravio format jer u SendClinetMessageToAll ne mozes parametre dodavat.
Ispravljeno je kao sto sam rekao radio sam preko mobitela
A to sto tebi nije korisno to je tvoje misljenje
Citat: [SC] - Rıckeη poslato Maj 09, 2013, 23:50:05 POSLE PODNE
Citat: C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc komanda xD
CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}
I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
SendClientMessageToAll(-1,"Admin OOC: %s",poruka);
}
}
Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Po meni ova komanda nije ni malo korisna. A imas i gresku tj nisi napravio format jer u SendClinetMessageToAll ne mozes parametre dodavat.
Citat: [WG:RP]C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc komanda xD
CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}
I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
new dstring[256];
format(dstring,sizeof(dstring),"Admin %s kaze: %s",ImeIgraca(playerid),inputtext);
SendClientMessageToAll(-1, dstring);
}
}
ImeIgraca stock:
stock ImeIgraca(playerid)
{
new ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, ime, sizeof(ime));
return ime;
}
Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Imas tu gresu specifikator
"i" je za brojeve a ne za slova
usput nisi definiso varijablu "poruka"
A takodje mislim da bi dobio warning
u
SendClientMessageToAll(-1,"Admin OOC: %s",poruka);
trebalo bi ici
new poruka[128];
if(sscanf(inputtext, "s[128]", poruka)) return ..
SendClientMessageToAll(-1, poruka);
Citat: --Lood-- poslato Maj 12, 2013, 22:16:06 POSLE PODNE
Citat: [SC] - Rıckeη poslato Maj 09, 2013, 23:50:05 POSLE PODNE
Citat: C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc komanda xD
CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}
I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
SendClientMessageToAll(-1,"Admin OOC: %s",poruka);
}
}
Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Po meni ova komanda nije ni malo korisna. A imas i gresku tj nisi napravio format jer u SendClinetMessageToAll ne mozes parametre dodavat.
Citat: [WG:RP]C_PAWN poslato Maj 09, 2013, 22:43:35 POSLE PODNE
Evo jedna moderna admin ooc komanda xD
CMD:ao(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste admin!");
ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
return 1;
}
I pod ondialogresponse
if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
new dstring[256];
format(dstring,sizeof(dstring),"Admin %s kaze: %s",ImeIgraca(playerid),inputtext);
SendClientMessageToAll(-1, dstring);
}
}
ImeIgraca stock:
stock ImeIgraca(playerid)
{
new ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, ime, sizeof(ime));
return ime;
}
Evo ovo sam pisao sa mobitela od 0 tako da su greske moguce ako nadjete ispravite ih ako nije problem :D
I takodje isplayeradmin zamjenite vasom varijablom
Imas tu gresu specifikator
"i" je za brojeve a ne za slova
usput nisi definiso varijablu "poruka"
A takodje mislim da bi dobio warning
u
SendClientMessageToAll(-1,"Admin OOC: %s",poruka);
trebalo bi ici
new poruka[128];
if(sscanf(inputtext, "s[128]", poruka)) return ..
SendClientMessageToAll(-1, poruka);
hvala na ispravci pisao sam preko mobitela pa nezz ni sta sam pisao xD
c_pawn: stavio si string 256, od toga koristis 17 karaktera, preterao si, to moze biti i ovako if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
new dstring[17 + MAX_PLAYER_NAME];
format(dstring,sizeof(dstring),"Admin %s kaze: %s",ImeIgraca(playerid),inputtext);
SendClientMessageToAll(-1, dstring);
}
}
Citat: Blaeks poslato Maj 16, 2013, 21:23:58 POSLE PODNE
c_pawn: stavio si string 256, od toga koristis 17 karaktera, preterao si, to moze biti i ovako if(dialogid == 1111)
{
if(response)
{
if (sscanf(params, "i", poruka)) return ShowPlayerDialog(playerid,1111,DIALOG_STYLE_INPUT,"Admin OOC Chat","Unesite vasu admin poruku","Posalji","Otkazi");
new dstring[17 + MAX_PLAYER_NAME];
format(dstring,sizeof(dstring),"Admin %s kaze: %s",ImeIgraca(playerid),inputtext);
SendClientMessageToAll(-1, dstring);
}
}
Tenk ju for koreksn
Navikao pisati velike stringove hahaha
if(strcmp(cmdtext,"/nagrade",true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
ShowPlayerDialog(playerid,222,DIALOG_STYLE_LIST,"Nagrade za igrace","Dupli respekt\nLevel up\nDodeli svima 500k \nDodeli svima 100k","Aktiviraj","Otkazi");
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"Nisi admin 1337-1338!");
}
return 1;
}
Ako bi mi neki mogo prebacit u YCMD (nisam pro u skriptanu ucim jos :r)
Hvala ti radi bez errora ali imam problem.
Kada kucam /nagrade izbaci dialog i dam primer igracima 500k pise pricekajte i ono ko da sam zaledjen i pise dobrodosli a ne dodje nista -.-"
a na strcmp mi je radilo normalno ://
Audio poruka za igraÄe, a ova komanda konkretno salje audio poruku onome ko kuca komandu.
Naravno stavio sam u zcmd i sscanf :D
CMD:amsg(playerid, params[])
{
//#pragma unused params
new text[128], string[400], sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, -1, "/amsg [TEKST]");
format(string, sizeof(string), "http://translate.google.com/translate_tts?tl=bs&q=%s",text);
PlayAudioStreamForPlayer(playerid, string);
return 1;
}
Vidio sam negdje ovu FS pa sam samo ispravio komandu i sad radi, mada ne kontam šta ovdje ima za FS xd
Provjere, play za sve igraÄe, i tako te stvari ubacujete vi :D
Ovo nije vidilo korisnog al je dobro za sprdnju :D
KLIK :$ (http://translate.google.com/translate_tts?tl=bs&q=fyodor%20je%20tata)
Evo vidim da svi stavljate neke komande pa odlucio sam da i jastavim dvije ali nisam baš nešto male su i lagane ali su u ZCMD procesuru komandi:
jedna za zivot
CMD:zivot(playerid, params[])
{
SetPlayerHealth(playerid, 99);
SendClientMessage(playerid, 0xFFFFFF, "Napunili ste si zivot");
return 1;
}
i druga za novac
CMD:novac(playerid, params[])
{
GivePlayerMoney(playerid, 10000);
SendClientMessage(playerid, 0x33CCFFAA, "igracu si dao 10000$");
return 1;
}
By Mato RP
Pa zasto nije dobro to su komande za pocetnike ali te komande nisu za rp sever bolje su za freeroam server ne?
Znaci ove dvije komande ne valjaju evo vam jedne poboljšanje ako si admin 1338 level da sve lijepo dobis:
CMD:admin(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] < 1338) return SendClientMessage(playerid, 0xFF1700EC, "Nisi admin level 1338!!!");
SendClientMessage(playerid, 0x33CCFFAA, "Uspjesno se se obukli,dobili zivot,dobili armour i promjenili skin u STAF!");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerMoney(playerid, 100000);
SetPlayerSkin(playerid, 217);
return 1;
}
NAPOMENA:trebate imati ZCMD procesor komandi i ovu boji 0x33CCFFAA ali vi mozete staviti koju hocete(zelite)
Citat: Matorp poslato Novembar 11, 2013, 10:25:35 PRE PODNE
Znaci ove dvije komande ne valjaju evo vam jedne poboljšanje ako si admin 1338 level da sve lijepo dobis:
CMD:admin(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] < 1338) return SendClientMessage(playerid, 0xFF1700EC, "Nisi admin level 1338!!!");
SendClientMessage(playerid, 0x33CCFFAA, "Uspjesno se se obukli,dobili zivot,dobili armour i promjenili skin u STAF!");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerMoney(playerid, 100000);
SetPlayerSkin(playerid, 217);
return 1;
}
NAPOMENA:trebate imati ZCMD procesor komandi i ovu boji 0x33CCFFAA ali vi mozete staviti koju hocete(zelite)
HP, i Armor stavi na 9999 ili 999 da ga uopste ne mogu ubiti jer ce se HP i ARMOR non stop sami vracati na full.
Novac je nepotreban ovde. Zbog abusa itd...
Citat: [AG:RP] Vito Georgiev poslato Novembar 12, 2013, 10:04:20 PRE PODNE
if(PlayerInfo[playerid][pAdminLevel] < 1338)
ZnaÄi ovo će imat samo admin level veći od 1338 ? Ako sam skontao.
1338 i veci leveli ako postoje
Citat: Correlli poslato Jul 30, 2010, 15:58:13 POSLE PODNE
Pobrisao sam sve postove u ovoj temi, jer 99% njih su bili za Godfather skriptu, a onaj 1% su bile komande koje se nisu vrijedne nazivati "korisnim".
Od sad naprijed kad budete postali korisne komande u ovu temu, onda gledajte da komanda stvarno bude korisna, a ne komanda kao iz Godfather skripte do koje može svako doći i izvaditi tu komandu sa malo znanja.
ZnaÄi da Godfather komande nisu korisne, jedino ako ste napravili svoju komandu za Godfather/Godfather edit i da je stvarno korisna za tu skriptu, ali onda morate napisati da je ta komanda SAMO za tu skriptu.
Ako komanda izgleda ovako (PRIMJER):
/* zcmd. */
command(mojakomanda, playerid, params[])
{
#pragma unused playerid
new
mojVarijabl[2];
mojVarijabl[0] = strval(params);
mojVarijabl[1] = izracunajFunkcija(mojVarijabl[0]);
return mojVarijabl[1];
}
ZnaÄi u ovoj komandi nepoznata je command() (zcmd procesor) funkcija i izracunajFunkcija (naÅ¡a funkcija) i to morate navesti, jer za poÄetnika ta komanda niÅ¡ta ne znaÄi ako ne zna koje su to funkcije i gdje ih treba tražiti.
Morate staviti link do funkcije ako nije vaša, ali ako je vaša, onda je stavite u post:
/* moja funkcija. */
stock izracunajFunkcija(vrijednost)
{
new
ukupno;
ukupno = ((vrijednost + 5) * 10);
return ukupno;
}
Link do zcmd procesora - http://zeex.pastebin.ca/1650602 (http://zeex.pastebin.ca/1650602)
Korištenje:
Stavite zcmd.inc fajl u vaÅ¡u mapu \pawno\include\ i ubacite ovo na poÄetak vaÅ¡e skripte (najbolje je odma iza #include <a_samp>):
#include <zcmd>
Tako nekako bi to trebalo izgledati.
Pozdrav,
[cenzura]
Napravio sam sve isto kao i ti i stavio sam command:eject(playerid,params[])
i kada idem provjeriti dali valja skripta kaze warning eject i command kao da nisu koriÅ¡tene,u Äemu je problem?
ajde kris ponasaj se, nemoj da psujes, jos jedna opomena i letis sa tog mesta, i ovako si bio upozorivan a i dalje pametujes
Citat: yui_sang poslato Decembar 02, 2013, 23:11:02 POSLE PODNE
Citat: Blaeks poslato Novembar 12, 2013, 15:53:07 POSLE PODNE
ajde kris ponasaj se, nemoj da psujes, jos jedna opomena i letis sa tog mesta, i ovako si bio upozorivan a i dalje pametujes
Ti se ponasaj lepoto
Kris nemas potrebe za dual acc-om. :)
Nemoj vise postati besmislene postove.
YCMD:sethp(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(PlayerInfo[playerid][pAdmin] < 3) return SCM(playerid, red, "Niste ovlasceni.");
new igr, hp;
if(sscanf(params, "ui", igr, hp)) return SCM(playerid, red, "{F57607}CMD: {00C3FF}/sethp [ID] [Kolicina]");
SetPlayerHealth(igr, hp);
return 1;
}
Sigurno ste se zapitali cemu ova komanda sluzi?
E pa evo vam odgovor, ona daje adminima mogucnost, da stave nekom igracu odredjen Health, znaci kada smo ubacili u pawno, idemo IG, i kucamo komandu /sethp [ID igraca] [Kolicina], to bi bilo to :)
Citat: David (Sabljak) A.k.A SABO(T) poslato Januar 13, 2014, 13:18:42 POSLE PODNE
Nije korisno al pohvale na copy/pasteu :)
Korisno je - tu i tamo :)
- Inace ovo sam radio jos pre za jedan forum SAMP isto, i sad posto dugo nista ovde nisam postavio, odlucio sam ovo, tako da nemoj misliti da je C/P :)
NaÅ¡a san svoj stari gf edit na laptopu pa eto neka obiÄna korisna komanda.. možda će nekom koristit možda ne.. meni je koristila ;) :)
CMD:tod(playerid,params[])
{
new sati, sats[128];
if(IsPlayerAdmin(playerid)) return SCM(playerid,-1,"Nisi admin!");
if(sscanf(params,"d", sati)) return SCM(playerid,-1,"/tod [sat]");
SetWorldTime(sati);
format(sats, sizeof(sats),"Postavio si sat na: %d", sati);
SendClientMessage(playerid, -1, sats);
return true;
}
Citat: [SX] TiXoR_ poslato Mart 04, 2014, 00:07:01 PRE PODNE
NaÅ¡a san svoj stari gf edit na laptopu pa eto neka obiÄna korisna komanda.. možda će nekom koristit možda ne.. meni je koristila ;) :)
CMD:tod(playerid,params[])
{
new sati, sats[128];
if(IsPlayerAdmin(playerid)) return SCM(playerid,-1,"Nisi admin!");
if(sscanf(params,"d", sati)) return SCM(playerid,-1,"/tod [sat]");
SetWorldTime(sati);
format(sats, sizeof(sats),"Postavio si sat na: %d", sati);
SendClientMessage(playerid, -1, sats);
return true;
}
Komanda je prosta..Trebao si nesto bolje stavit ali eto za pocetnika je dobro.
Prilagodite sebi
CMD:aweapon(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) if(PlayerInfo[playerid][pAdminLevel] < 5) return SCM(playerid,COLOR_RED,"ERROR:Nemate autorizaciju da koristite ovu komandu - nemate dovoljan admin level.");
{
new id, weaponid, ammo;
if(sscanf(params, "udd", id, weaponid, ammo)) SendClientMessage(playerid, -1, "KORISTI: /aweapon [Igracev ID] [Oruzje ID] [Metci]");
else if (!IsPlayerConnected(id)) return SCM(playerid, -1, "ERROR:Igrac nije na serveru.");
GivePlayerWeapon(id, weaponid, ammo);
}
return 1;
}
ObiÄna komanda samo Å¡ta koristiÅ¡ nepotrebnu funkciju IsPlayerConnected.. bolje je koristit INVALID_PLAYER_ID
Evo od mene komanda /pay.
Ta komanda služi za davanje novca, igraÄ igraÄu.
Za komandu vam treba: ZCMD, SSCANF,foreach
CMD:pay(playerid,params[])
{
new
pid,
pn,
str[128],
str2[128];
if(sscanf(params, "ud", pid,pn)) return SCM(playerid,-1,"KOMANDA: /pay [id] [kolicina]");
if(pn > GetPlayerMoney(playerid)) return SCM(playerid,-1,"Nemate toliko novaca! Odaberite drugu valutu!");
if(pn < 0 || pn > 99999999) return SCM(playerid,-1,"Možete davati novce izmeÄ'u $0 i $99999999");
else if(pid == INVALID_PLAYER_ID) return SCM(playerid,-1,"Ovaj igraÄ nije na serveru!");
GivePlayerMoney(pid,pn);
format(str,sizeof str,"IgraÄ %s vam je dao $%d!",GetName(playerid),pn);
SCM(pid,-1,str);
format(str2,sizeof str2,"IgraÄ %s je dao igraÄu %s $%d!",GetName(playerid),GetName(pid),pn);
SendAdminMessage(-1,str2);
return true;
}
stock GetName(playerid)
{
new pName[MAX_PLAYER_NAME], usPos;
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
usPos = strfind(pName, "_");
if (usPos != -1) pName[usPos] = ' ';
return pName;
}
Ova funkcija GetName, će maknuti igraÄu "_" iz imena. ;)
stock SendAdminMessage(color, string[])
{
foreach(Player, i)
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, color, string);
}
}
}
Ova gore funkcija služi da se poruka šalje adminima.
Nadam se da će nekome poslužiti ova komanda!
Evo jedna korisna i jednostavna cmd od mene
CMD:gt(playerid, params[])
{
if(PlayerInfo[playerid][Admin] > 0)
{
new id, text[128];
if(sscanf(params, "is[128]", id, text)) return SCM(playerid, GRAD2, "Koristite /gt [Stil] [Tekst]");
if(id < 0 || id > 6) return SCM(playerid, GRAD2, "Stil moze biti samo 0, 1, 3, 4, 5, 6.");
GameTextForAll(text, 5000, id);
}
else return SCM(playerid, GRAD2, "Nemate autorizaciju za koristenje ove naredbe!");
return 1;
}
Citat: Roby Deen poslato Jul 15, 2014, 22:45:00 POSLE PODNE
Evo jedna korisna i jednostavna cmd od mene
CMD:gt(playerid, params[])
{
if(PlayerInfo[playerid][Admin] > 0)
{
new id, text[128];
if(sscanf(params, "is[128]", id, text)) return SCM(playerid, GRAD2, "Koristite(playerid, "gt [Stil] [Tekst]");
if(id < 0 || id > 6) return SCM(playerid, GRAD2, "Stil moze biti samo 0, 1, 3, 4, 5, 6.");
GameTextForAll(text, 5000, id);
}
else return SCM(playerid, GRAD2, "Nemate autorizaciju za koristenje ove naredbe!");
return 1;
}
pa dobro, nije bas previse korisna, ali fino, lepo je sto se trudis
Ovo je komanda namijenjena za admine i GM.Npr. na eventu dajete novac igracima i sa ovom komandom vama nece oduzeti novac a igracu ce ipak dati novac.Tako vlasnici nece morati davati novac staff timu za evente i tako se necete morati brinuti da staff tim daje novac svojim drugovima i sl.
CMD:plati(playerid, params[])
{
if(PlayerInfo[playerid][pAdminl] < 1 || PlayerInfo[playerid][pGM] < 1) return SCM(playerid, GRAD2, "Niste ovlasceni koristiti ovu komandu!");// ovdje stavljate kako su vam definirani Admini/GM
new target, money;
if(sscanf(params, "ud", target, money)) return SCM(playerid, GRAD2, "/plati [ID/Ime] [Novac]");
if(target == INVALID_PLAYER_ID) return SCM(playerid, GRAD2, "Pogresan ID!");
if(target == playerid) return SCM(playerid, GRAD2, "Ne mozete samom sebi dati novac!");
if(money < 1) return SCM(playerid, GRAD2, "Suma novca ne moze biti manja od 1!");
new Float:Pos[3]; GetPlayerPos(target,Pos[0],Pos[1],Pos[2]);
if(!IsPlayerInRangeOfPoint(playerid,4.0,Pos[0],Pos[1],Pos[2])) return SCM(playerid, GRAD2, "Igrac nije blizu vas!");
new string[128];
g_NovacPlus(target, money);// ovdje upisujete kako je kod vas za davanje novca
format(string, sizeof(string), "{FFFFFF}%s ti je dao $%d.", GetName(playerid), money);
SCM(target, -1, string);
format(string, sizeof(string), "{FFFFFF}Dali ste igracu %s %d$.", GetName(target), money);
SCM(playerid, -1, string);
SavePlayer(target);
return 1;
}
@Roby: Korisne komande, samo nemoj vadit iz NL Moda :3 :'( :'(
Čemu služi proxdetector?
On sluzi kao radius za chat. Znaci on salje jedan chat u nekom odredjenom radiusu tj. "prostoru". Primer ti je IC chat. Znaci nece ga videti svi, vec samo oni koji su u radiusu koji je odredjen u ProxDetectoru
EDIT: Ne mora bit chat, moze biti bilo koji string primer recimo (/me,/do,/w,/b,T) znaci tu se svuda koristi proxdetector
Hvala pokusat cu nekako skontat to...
Sve sam ove komande pregledao za nekih pola sata i bravo vi.
bolje koristi hprox, potraži ga na forumu.
Evo jedna jednostavna /am komanda
CMD:am(playerid,paramas[])
{
new string[128],name[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 1 && IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_RED,"ERROR: Niste autorizirani koristiti ovu komandu - nemate dovoljni administratorski level.");
{
if(sscanf(paramas,"s[128]",string)) return SCM(playerid,COLOR_LIGHTBLUE,"* /am [Text]");
else
{
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"(( Admin %s: %s ))",name,string);
SCMTA(COLOR_WHITE,string);
}
}
return 1;
}
Citat: kolobaric poslato Septembar 20, 2014, 13:17:12 POSLE PODNE
Evo jedna jednostavna /am komanda
CMD:am(playerid,paramas[])
{
new string[128],name[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 1 && IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_RED,"ERROR: Niste autorizirani koristiti ovu komandu - nemate dovoljni administratorski level.");
{
if(sscanf(paramas,"s[128]",string)) return SCM(playerid,COLOR_LIGHTBLUE,"* /am [Text]");
else
{
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"(( Admin %s: %s ))",name,string);
SCMTA(COLOR_WHITE,string);
}
}
return 1;
}
pAdmin, SCMTA, sscanf, ZCMD, COLOR_LIGHTBLUE, COLOR_WHITE, COLOR_RED, PlayerInfo ?
Evo jedna komanda od mene za busenje guma, nisam je testirao neka je neko testira pa ako ne radi neka mi posalje PM.
if(strcmp(cmd, "/busi", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /busi [playerid/PartOfName] [id]");
SendClientMessage(playerid, COLOR_WHITE, "0. Sve gume");
SendClientMessage(playerid, COLOR_WHITE, "1. Zadnja desna");
SendClientMessage(playerid, COLOR_WHITE, "2. Prednja desna");
SendClientMessage(playerid, COLOR_WHITE, "3. Zadnja leva");
SendClientMessage(playerid, COLOR_WHITE, "4. Prednja leva");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
if(IsPlayerConnected(para1))
{
if(IsPlayerInAnyVehicle(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /busi [playerid/PartOfName] [id]");
SendClientMessage(playerid, COLOR_WHITE, "0. Sve gume");
SendClientMessage(playerid, COLOR_WHITE, "1. Zadnja desna");
SendClientMessage(playerid, COLOR_WHITE, "2. Prednja desna");
SendClientMessage(playerid, COLOR_WHITE, "3. Zadnja leva");
SendClientMessage(playerid, COLOR_WHITE, "4. Prednja leva");
return 1;
}
new guma;
guma = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /busi [playerid/PartOfName] [id]");
SendClientMessage(playerid, COLOR_WHITE, "0. Sve gume");
SendClientMessage(playerid, COLOR_WHITE, "1. Zadnja desna");
SendClientMessage(playerid, COLOR_WHITE, "2. Prednja desna");
SendClientMessage(playerid, COLOR_WHITE, "3. Zadnja leva");
SendClientMessage(playerid, COLOR_WHITE, "4. Prednja leva");
return 1;
}
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(para1 == playerid) return SendClientMessage(playerid, COLOR_GREY, " Ne mozete sami sebi da izbusite gumu !");
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(id);
switch (stat)
{
case 0:
{
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 15);
}
case 1:
{
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 1);
}
case 2:
{
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 2);
}
case 3:
{
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 4);
}
case 4:
{
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 8);
}
default:
{
format(string, sizeof(string), " Pogresan broj gume!", amount);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Taj igrac nije online!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Taj igrac nije u vozilu!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized!");
}
}
}
}
return 1;
}
Citat: Seiz poslato Septembar 30, 2014, 14:16:12 POSLE PODNE
Evo jedna komanda od mene za busenje guma, nisam je testirao neka je neko testira pa ako ne radi neka mi posalje PM.
if(strcmp(cmd, "/busi", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /busi [playerid/PartOfName] [id]");
SendClientMessage(playerid, COLOR_WHITE, "0. Sve gume");
SendClientMessage(playerid, COLOR_WHITE, "1. Zadnja desna");
SendClientMessage(playerid, COLOR_WHITE, "2. Prednja desna");
SendClientMessage(playerid, COLOR_WHITE, "3. Zadnja leva");
SendClientMessage(playerid, COLOR_WHITE, "4. Prednja leva");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
if(IsPlayerConnected(para1))
{
if(IsPlayerInAnyVehicle(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /busi [playerid/PartOfName] [id]");
SendClientMessage(playerid, COLOR_WHITE, "0. Sve gume");
SendClientMessage(playerid, COLOR_WHITE, "1. Zadnja desna");
SendClientMessage(playerid, COLOR_WHITE, "2. Prednja desna");
SendClientMessage(playerid, COLOR_WHITE, "3. Zadnja leva");
SendClientMessage(playerid, COLOR_WHITE, "4. Prednja leva");
return 1;
}
new guma;
guma = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /busi [playerid/PartOfName] [id]");
SendClientMessage(playerid, COLOR_WHITE, "0. Sve gume");
SendClientMessage(playerid, COLOR_WHITE, "1. Zadnja desna");
SendClientMessage(playerid, COLOR_WHITE, "2. Prednja desna");
SendClientMessage(playerid, COLOR_WHITE, "3. Zadnja leva");
SendClientMessage(playerid, COLOR_WHITE, "4. Prednja leva");
return 1;
}
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(para1 == playerid) return SendClientMessage(playerid, COLOR_GREY, " Ne mozete sami sebi da izbusite gumu !");
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(id);
switch (stat)
{
case 0:
{
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 15);
}
case 1:
{
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 1);
}
case 2:
{
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 2);
}
case 3:
{
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 4);
}
case 4:
{
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 8);
}
default:
{
format(string, sizeof(string), " Pogresan broj gume!", amount);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Taj igrac nije online!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Taj igrac nije u vozilu!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized!");
}
}
}
}
return 1;
}
format(string, sizeof(string), " Pogresan broj gume!", amount);
gdje je parametar?
BUMP
Koristite malo i ovu temu.
Evo jedna korisna komanda
//=================//
CMD:baci(playerid,params[])
{
new string[128];
new sendername[MAX_PLAYER_NAME];
new Float:X,Float:Y,Float:Z;
new GunID = GetPlayerWeapon(playerid);
new GunAmmo = GetPlayerAmmo(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerPos(playerid, X, Y, Z);
RemovePlayerWeapon(playerid, GunID);
DropGun(playerid, GunID,GunAmmo,X,Y,Z,GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
format(string, 128, "* %s je bacio oruzje na pod.", GetName(playerid));
ProxDetector(10.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
return 1;
}
//=================//
CMD:podigni(playerid,params[])
{
new string[128];
new sendername[MAX_PLAYER_NAME];
for(new i = 0; i < sizeof(DropInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
{
if(GetPlayerVirtualWorld(playerid) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(playerid) == DropInfo[i][DropGunInterior])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
DestroyDynamicObject(DropObject[i]);
GivePlayerWeapon(playerid,DropInfo[i][DropGunAmmount][0],DropInfo[i][DropGunAmmount][1]);
DropInfo[i][DropGunPosX] = 0.0;
DropInfo[i][DropGunPosY] = 0.0;
DropInfo[i][DropGunPosZ] = 0.0;
DropInfo[i][DropGunAmmount][0] = 0;
DropInfo[i][DropGunAmmount][1] = 0;
format(string, 128, "* %s uzima u ruku te podize oruzje s poda.", GetName(playerid));
ProxDetector(10.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
return 1;
}
}
}
return 1;
}
Citat: alko321 poslato Januar 31, 2015, 16:56:39 POSLE PODNE
Evo jedna korisna komanda
//=================//
CMD:baci(playerid,params[])
{
new string[128];
new sendername[MAX_PLAYER_NAME];
new Float:X,Float:Y,Float:Z;
new GunID = GetPlayerWeapon(playerid);
new GunAmmo = GetPlayerAmmo(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerPos(playerid, X, Y, Z);
RemovePlayerWeapon(playerid, GunID);
DropGun(playerid, GunID,GunAmmo,X,Y,Z,GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
format(string, 128, "* %s je bacio oruzje na pod.", GetName(playerid));
ProxDetector(10.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
return 1;
}
//=================//
CMD:podigni(playerid,params[])
{
new string[128];
new sendername[MAX_PLAYER_NAME];
for(new i = 0; i < sizeof(DropInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
{
if(GetPlayerVirtualWorld(playerid) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(playerid) == DropInfo[i][DropGunInterior])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
DestroyDynamicObject(DropObject[i]);
GivePlayerWeapon(playerid,DropInfo[i][DropGunAmmount][0],DropInfo[i][DropGunAmmount][1]);
DropInfo[i][DropGunPosX] = 0.0;
DropInfo[i][DropGunPosY] = 0.0;
DropInfo[i][DropGunPosZ] = 0.0;
DropInfo[i][DropGunAmmount][0] = 0;
DropInfo[i][DropGunAmmount][1] = 0;
format(string, 128, "* %s uzima u ruku te podize oruzje s poda.", GetName(playerid));
ProxDetector(10.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
return 1;
}
}
}
return 1;
}
Å¡ta je ovdje korisno,korisno je to Å¡to poÄetnici neće moci da razume ni boje koje si stavio a kamoli enuma dropinfo i to sve trebao si malo to objasnit ...al eto ovo je samo komanda
Citat: alko321 poslato Januar 31, 2015, 16:56:39 POSLE PODNE
Evo jedna korisna komanda
//=================//
CMD:baci(playerid,params[])
{
new string[128];
new sendername[MAX_PLAYER_NAME];
new Float:X,Float:Y,Float:Z;
new GunID = GetPlayerWeapon(playerid);
new GunAmmo = GetPlayerAmmo(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerPos(playerid, X, Y, Z);
RemovePlayerWeapon(playerid, GunID);
DropGun(playerid, GunID,GunAmmo,X,Y,Z,GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
format(string, 128, "* %s je bacio oruzje na pod.", GetName(playerid));
ProxDetector(10.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
return 1;
}
//=================//
CMD:podigni(playerid,params[])
{
new string[128];
new sendername[MAX_PLAYER_NAME];
for(new i = 0; i < sizeof(DropInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
{
if(GetPlayerVirtualWorld(playerid) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(playerid) == DropInfo[i][DropGunInterior])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
DestroyDynamicObject(DropObject[i]);
GivePlayerWeapon(playerid,DropInfo[i][DropGunAmmount][0],DropInfo[i][DropGunAmmount][1]);
DropInfo[i][DropGunPosX] = 0.0;
DropInfo[i][DropGunPosY] = 0.0;
DropInfo[i][DropGunPosZ] = 0.0;
DropInfo[i][DropGunAmmount][0] = 0;
DropInfo[i][DropGunAmmount][1] = 0;
format(string, 128, "* %s uzima u ruku te podize oruzje s poda.", GetName(playerid));
ProxDetector(10.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
return 1;
}
}
}
return 1;
}
užas. daj molin te pogledaj kako su drugi objavljivali, to zapravo nije ništa
Pise li korisne komande ?? ili pise Objasni sve sto treba ??
Citat: alko321 poslato Januar 31, 2015, 22:30:31 POSLE PODNE
Pise li korisne komande ?? ili pise Objasni sve sto treba ??
haahahha, korisne komande bez ikakve definicije, je svima je korisna.
hhoces da ti ja dam komandu extra je korisna ali neces je nikad prialogodit svom modu
Citat: arnel avdic poslato Januar 31, 2015, 22:39:31 POSLE PODNE
hhoces da ti ja dam komandu extra je korisna ali neces je nikad prialogodit svom modu
Izvini Arnele nisam te prepoznao aj daj komandu pa ti posaljem SS
Citat: alko321 poslato Februar 01, 2015, 00:20:34 PRE PODNE
Citat: arnel avdic poslato Januar 31, 2015, 22:39:31 POSLE PODNE
hhoces da ti ja dam komandu extra je korisna ali neces je nikad prialogodit svom modu
Izvini Arnele nisam te prepoznao aj daj komandu pa ti posaljem SS
sutra Äim ustanem jer sam na laptopu i hoću boga mi ti poslat tako da je oÄekujem sutra u toku dana
Bilo mi je dosadno pa evo: /report koji sprema reporte da ih admini mogu citati lagano i odgovarati na jedan po jedan, igrac vidi kada njegov report bude procitan i vidi koji admin je procitao report, moze biti znacajno i kod uvidjaja koji admini rade a koji ne..
Pre svega za ovo su vam potrebni include zcmd i plugin+include sscanf2
Najpre ovo dodate na vrh moda ispod includova
#define MAX_REPORTS 100
enum reportInfo {
Ime[MAX_PLAYER_NAME],
Report[128],
Vreme[40],
ID
} new Reports[MAX_REPORTS][reportInfo];
stock ResetujReport(id) {
format(Reports[id][Ime],MAX_PLAYER_NAME,"%s","Niko");
return 1;
}
Zatim komande
CMD:report(playerid,params[]) {
new text[128];
if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,-1," > Koristi: /report [text]");
for(new i = 0; i < MAX_REPORTS; i++) {
if(Reports[i][ID] == playerid) SendClientMessage(playerid,-1," > Vec si poslao jedan report na koji niko nije odgovorio, sacekaj odgovor!");
return 1;
}
new bool:p; new reportnum;
for(new i = 0; i < MAX_REPORTS; i++) {
if(!p) {
if(strcmp(Reports[i][Ime],"Niko",false) == 0) {
p = true;
reportnum = i;
}
}
}
if(!p) return SendClientMessage(playerid,-1,"Trenutno postoji 100 neprocitanih reporta, sacekajte dok se rascisti!");
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
new timestr[64]; new dan,mesec,god,sat,minut,sek;
getdate(god,mesec,dan); gettime(sat,minut,sek);
format(timestr,sizeof(timestr),"%02d/%02d/%d, %02d:%02d:%02d",dan,mesec,god,sat,minut,sek);
format(Reports[reportnum][Ime],MAX_PLAYER_NAME,"%s",name);
format(Reports[reportnum][Report],128,"%s",text);
format(Reports[reportnum][Vreme],40,"%s",timestr);
Reports[reportnum][ID] = playerid;
SendClientMessage(playerid,-1," > Vas report je poslan, dobicete odgovor u najkracem roku!");
new str[150];
format(str,150, " > Vas report glasi: %s",text);
SendClientMessage(playerid,-1,str);
return 1;
}
CMD:reports(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
new str[128]; new c = 0;
for(new i = 0; i < MAX_REPORTS; i++) {
if(strcmp(Reports[i][Ime],"Niko",false) != 0) {
format(str,128," > ID reporta: %d, Igrac %s[%d], Kada je poslao report: %s",i,Reports[i][Ime],Reports[i][ID],Reports[i][Vreme]);
SendClientMessage(playerid,-1,str);
c++;
}
}
if(c == 0) return SendClientMessage(playerid,-1, " > Nema neprocitanih reportova!");
}
return 1;
}
CMD:procitajreport(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
new id;
if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1," > Koristi: /procitajreport [id reporta]");
else if(id < 0 || id > MAX_REPORTS-1) return SendClientMessage(playerid,-1, " > Pogresan ID reporta!");
if(strcmp(Reports[id][Ime],"Niko",false) == 0) return SendClientMessage(playerid,-1," > Nema reporta na ovom IDu!");
new str[150];
format(str,150," > Igrac: %s[%d] | Datum i vreme pisanja reporta: %s",Reports[id][Ime],Reports[id][ID],Reports[id][Vreme]);
SendClientMessage(playerid,-1,str);
format(str,150," > Report: %s",Reports[id][Report]);
SendClientMessage(playerid,-1,str);
new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name));
format(str,150," > Admin %s je procitao vas report!",name);
SendClientMessage(Reports[id][ID],-1, str);
ResetujReport(id);
}
return 1;
}
Zatim ovo dodate pod OnGameModeInit:
for(new i = 0; i < MAX_REPORTS; i++) ResetujReport(i);
I na kraju ovo pod OnPlayerDisconnect:
for(new i = 0; i < MAX_REPORTS; i++) {
if(Reports[i][ID] == playerid) ResetujReport(i);
}
pa eto mozda kome i posluzi :)
Citat: dock poslato Februar 16, 2015, 04:26:42 PRE PODNE
Bilo mi je dosadno pa evo: /report koji sprema reporte da ih admini mogu citati lagano i odgovarati na jedan po jedan, igrac vidi kada njegov report bude procitan i vidi koji admin je procitao report, moze biti znacajno i kod uvidjaja koji admini rade a koji ne..
Pre svega za ovo su vam potrebni include zcmd i plugin+include sscanf2
Najpre ovo dodate na vrh moda ispod includova
#define MAX_REPORTS 100
enum reportInfo {
Ime[MAX_PLAYER_NAME],
Report[128],
Vreme[40],
ID
} new Reports[MAX_REPORTS][reportInfo];
stock ResetujReport(id) {
format(Reports[id][Ime],MAX_PLAYER_NAME,"%s","Niko");
return 1;
}
Zatim komande
CMD:report(playerid,params[]) {
new text[128];
if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,-1," > Koristi: /report [text]");
for(new i = 0; i < MAX_REPORTS; i++) {
if(Reports[i][ID] == playerid) SendClientMessage(playerid,-1," > Vec si poslao jedan report na koji niko nije odgovorio, sacekaj odgovor!");
return 1;
}
new bool:p; new reportnum;
for(new i = 0; i < MAX_REPORTS; i++) {
if(!p) {
if(strcmp(Reports[i][Ime],"Niko",false) == 0) {
p = true;
reportnum = i;
}
}
}
if(!p) return SendClientMessage(playerid,-1,"Trenutno postoji 100 neprocitanih reporta, sacekajte dok se rascisti!");
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
new timestr[64]; new dan,mesec,god,sat,minut,sek;
getdate(god,mesec,dan); gettime(sat,minut,sek);
format(timestr,sizeof(timestr),"%02d/%02d/%d, %02d:%02d:%02d",dan,mesec,god,sat,minut,sek);
format(Reports[reportnum][Ime],MAX_PLAYER_NAME,"%s",name);
format(Reports[reportnum][Report],128,"%s",text);
format(Reports[reportnum][Vreme],40,"%s",timestr);
Reports[reportnum][ID] = playerid;
SendClientMessage(playerid,-1," > Vas report je poslan, dobicete odgovor u najkracem roku!");
new str[150];
format(str,150, " > Vas report glasi: %s",text);
SendClientMessage(playerid,-1,str);
return 1;
}
CMD:reports(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
new str[128]; new c = 0;
for(new i = 0; i < MAX_REPORTS; i++) {
if(strcmp(Reports[i][Ime],"Niko",false) != 0) {
format(str,128," > ID reporta: %d, Igrac %s[%d], Kada je poslao report: %s",i,Reports[i][Ime],Reports[i][ID],Reports[i][Vreme]);
SendClientMessage(playerid,-1,str);
c++;
}
}
if(c == 0) return SendClientMessage(playerid,-1, " > Nema neprocitanih reportova!");
}
return 1;
}
CMD:procitajreport(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
new id;
if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1," > Koristi: /procitajreport [id reporta]");
else if(id < 0 || id > MAX_REPORTS-1) return SendClientMessage(playerid,-1, " > Pogresan ID reporta!");
if(strcmp(Reports[id][Ime],"Niko",false) == 0) return SendClientMessage(playerid,-1," > Nema reporta na ovom IDu!");
new str[150];
format(str,150," > Igrac: %s[%d] | Datum i vreme pisanja reporta: %s",Reports[id][Ime],Reports[id][ID],Reports[id][Vreme]);
SendClientMessage(playerid,-1,str);
format(str,150," > Report: %s",Reports[id][Report]);
SendClientMessage(playerid,-1,str);
new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name));
format(str,150," > Admin %s je procitao vas report!",name);
SendClientMessage(Reports[id][ID],-1, str);
ResetujReport(id);
}
return 1;
}
Zatim ovo dodate pod OnGameModeInit:
for(new i = 0; i < MAX_REPORTS; i++) ResetujReport(i);
I na kraju ovo pod OnPlayerDisconnect:
for(new i = 0; i < MAX_REPORTS; i++) {
if(Reports[i][ID] == playerid) ResetujReport(i);
}
pa eto mozda kome i posluzi :)
lijepa ideja i korisna komanda. bravo.
Sa ovom komandom iskljuÄujemo glavni chat !
#include <a_samp>
#include <zcmd>
#define DIALOG_CHAT 1
new UgasenChat;
CMD:chat(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste rcon admin !");
ShowPlayerDialog(playerid, DIALOG_CHAT, DIALOG_STYLE_LIST, "Ugasi ili upali chat","Upali chat\nUgasi chat" , "Izaberi", "Izadji");
return 1;
}
public OnPlayerText(playerid, text[])
{
if(UgasenChat == 1)
{
SendClientMessage(playerid,-1,"Chat je ugašen !");
return 0;
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_CHAT)
{
if(response)
{
switch(listitem)
{
case 0:
{
new string[64];
if(UgasenChat == 0) return SendClientMessage(playerid,-1,"Glavni chat nije ugašen !");
format(string,sizeof(string),"Admin %s je upalio chat !!",GetName(playerid));
SendClientMessageToAll(-1,string);
UgasenChat = 0;
}
case 1:
{
new string[64];
if(UgasenChat == 1) return SendClientMessage(playerid,-1,"Glavni chat je već ugašen !");
format(string,sizeof(string),"Admin %s je ugasio chat !",GetName(playerid));
SendClientMessageToAll(-1,string);
UgasenChat = 1;
}
}
}
}
return 1;
}
stock GetName(playerid)
{
new JName[MAX_PLAYER_NAME];
GetPlayerName(playerid,JName,MAX_PLAYER_NAME);
return JName;
}
CMD:flip(playerid,params[])
{
new Veh, Float:X, Float:Y, Float:Z, Float:A;
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"Nisi u vozilu !");
GetPlayerPos(playerid, X, Y, Z);
Veh = GetPlayerVehicleID(playerid);
GetVehicleZAngle(Veh, A);
SetVehiclePos(Veh, X, Y, Z);
SetVehicleZAngle(Veh, A);
SetVehicleHealth(Veh,1000.0);
GameTextForPlayer(playerid,"~g~Uspjesno",5000,1);
return 1;
}
eto jedna komanda s kojom cete prevrnuti vozilo odnosno vratiti na pocetak
Citat: arnel avdic poslato April 20, 2015, 18:30:08 POSLE PODNE
Sa ovom komandom iskljuÄujemo glavni chat !
#include <a_samp>
#include <zcmd>
#define DIALOG_CHAT 1
new UgasenChat;
CMD:chat(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Niste rcon admin !");
ShowPlayerDialog(playerid, DIALOG_CHAT, DIALOG_STYLE_LIST, "Ugasi ili upali chat","Upali chat\nUgasi chat" , "Izaberi", "Izadji");
return 1;
}
public OnPlayerText(playerid, text[])
{
if(UgasenChat == 1)
{
SendClientMessage(playerid,-1,"Chat je ugašen !");
return 0;
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_CHAT)
{
if(response)
{
switch(listitem)
{
case 0:
{
new string[64];
if(UgasenChat == 0) return SendClientMessage(playerid,-1,"Glavni chat nije ugašen !");
format(string,sizeof(string),"Admin %s je upalio chat !!",GetName(playerid));
SendClientMessageToAll(-1,string);
UgasenChat = 0;
}
case 1:
{
new string[64];
if(UgasenChat == 1) return SendClientMessage(playerid,-1,"Glavni chat je već ugašen !");
format(string,sizeof(string),"Admin %s je ugasio chat !",GetName(playerid));
SendClientMessageToAll(-1,string);
UgasenChat = 1;
}
}
}
}
return 1;
}
stock GetName(playerid)
{
new JName[MAX_PLAYER_NAME];
GetPlayerName(playerid,JName,MAX_PLAYER_NAME);
return JName;
}
Lijepo i korisno :D
Ova komanda je meni bas trebala prosle godine kada sam pravio RP server i nikako je nisam mogao naci,a nisam je znao napraviti.Nadam se da ce nekome koristiti :D
Napomena:Komanda preuzeta iz GG moda
CMD:gotocp(playerid, params[])
{
if(PI[playerid][Admin] >= 6 || IsPlayerAdmin(playerid))
{
if(IgracevCPPrikazan[playerid] == false) return SCM(playerid, GRAD2, "[{F81414}Greska!{FFFFFF}] Trenutno nije prikazan nijedan Checkpoint!");
if(IsPlayerInAnyVehicle(playerid)) NovaPozicijaV(playerid, CheckpointX[playerid], CheckpointY[playerid], CheckpointZ[playerid]);
else if(!IsPlayerInAnyVehicle(playerid)) SetPlayerPos_H(playerid, CheckpointX[playerid], CheckpointY[playerid], CheckpointZ[playerid]);
SCM(playerid, GRAD2, "Teleportovani ste do checkpointa!");
}
else return SCM(playerid, GRAD2, "[{F81414}Greska!{FFFFFF}] Niste autorizovani da koristite ovu komandu!");
return 1;
}
new PI[BROJ_SLOTOVA][pInfo];
new bool:IgracevCPPrikazan[BROJ_SLOTOVA];
new Float:CheckpointX[BROJ_SLOTOVA];
new Float:CheckpointY[BROJ_SLOTOVA];
new Float:CheckpointZ[BROJ_SLOTOVA];
stock NovaPozicijaV(playerid, Float:X, Float:Y, Float:Z)
{
if(!IsPlayerConnected(playerid)) return 1;
if(!IsPlayerInAnyVehicle(playerid)) return SetPlayerPos_H(playerid, X, Y, Z);
SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
h_TogglePlayerControllable(playerid,0);//this will freeze player
SetTimerEx("Unfreeze",2000,0,"i",playerid);
return 1;
}
stock SetPlayerPos_H(playerid, Float:X, Float:Y, Float:Z)
{
if(!IsPlayerConnected(playerid)) return 1;
SetPlayerPos(playerid, X, Y, Z);
h_TogglePlayerControllable(playerid,0);//this will freeze player
SetTimerEx("Unfreeze",2000,0,"i",playerid);
return 1;
}
I to je to ;D
@TheTorreto Komanda nije dobra, ima nepotrebnih stvari sto si stavio da se doda a i fali stock h_SetPlayerCheckPoint...
ovako bi trebalo izgledati:
CMD:gotocp(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if(IgracevCPPrikazan[playerid] == false) return SCM(playerid, GRAD2, "[{F81414}Greska!{FFFFFF}] Trenutno nije prikazan nijedan Checkpoint!");
if(IsPlayerInAnyVehicle(playerid)) NovaPozicijaV(playerid, CheckpointX[playerid], CheckpointY[playerid], CheckpointZ[playerid]);
else if(!IsPlayerInAnyVehicle(playerid)) SetPlayerPos(playerid, CheckpointX[playerid], CheckpointY[playerid], CheckpointZ[playerid]);
SCM(playerid, GRAD2, "Teleportovani ste do checkpointa!");
}
else return SCM(playerid, GRAD2, "[{F81414}Greska!{FFFFFF}] Niste autorizovani da koristite ovu komandu!");
return 1;
}
new bool:IgracevCPPrikazan[MAX_PLAYERS];
new Float:CheckpointX[MAX_PLAYERS];
new Float:CheckpointY[MAX_PLAYERS];
new Float:CheckpointZ[MAX_PLAYERS];
stock NovaPozicijaV(playerid, Float:X, Float:Y, Float:Z)
{
if(!IsPlayerConnected(playerid)) return 1;
if(!IsPlayerInAnyVehicle(playerid)) return SetPlayerPos(playerid, X, Y, Z);
SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
return 1;
}
stock h_SetPlayerCheckpoint(playerid, Float:X, Float:Y, Float:Z, Float:radius)
{
CheckpointX[playerid] = X;
CheckpointY[playerid] = Y;
CheckpointZ[playerid] = Z;
CheckpointR[playerid] = radius;
IgracevCPPrikazan[playerid] = true;
SetPlayerCheckpoint(playerid, X, Y, Z, radius);
return 1;
}
stock h_DisablePlayerCheckpoint(playerid)
{
CheckpointX[playerid] = 0.0000;
CheckpointY[playerid] = 0.0000;
CheckpointZ[playerid] = 0.0000;
CheckpointR[playerid] = 0.0000;
IgracevCPPrikazan[playerid] = false;
return DisablePlayerCheckpoint(playerid);
}
Citat: Vuzimir poslato Jun 19, 2015, 22:16:06 POSLE PODNE
@TheTorreto Komanda nije dobra, ima nepotrebnih stvari sto si stavio da se doda a i fali stock h_SetPlayerCheckPoint...
ovako bi trebalo izgledati:
CMD:gotocp(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if(IgracevCPPrikazan[playerid] == false) return SCM(playerid, GRAD2, "[{F81414}Greska!{FFFFFF}] Trenutno nije prikazan nijedan Checkpoint!");
if(IsPlayerInAnyVehicle(playerid)) NovaPozicijaV(playerid, CheckpointX[playerid], CheckpointY[playerid], CheckpointZ[playerid]);
else if(!IsPlayerInAnyVehicle(playerid)) SetPlayerPos(playerid, CheckpointX[playerid], CheckpointY[playerid], CheckpointZ[playerid]);
SCM(playerid, GRAD2, "Teleportovani ste do checkpointa!");
}
else return SCM(playerid, GRAD2, "[{F81414}Greska!{FFFFFF}] Niste autorizovani da koristite ovu komandu!");
return 1;
}
new bool:IgracevCPPrikazan[MAX_PLAYERS];
new Float:CheckpointX[MAX_PLAYERS];
new Float:CheckpointY[MAX_PLAYERS];
new Float:CheckpointZ[MAX_PLAYERS];
stock NovaPozicijaV(playerid, Float:X, Float:Y, Float:Z)
{
if(!IsPlayerConnected(playerid)) return 1;
if(!IsPlayerInAnyVehicle(playerid)) return SetPlayerPos(playerid, X, Y, Z);
SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
return 1;
}
stock h_SetPlayerCheckpoint(playerid, Float:X, Float:Y, Float:Z, Float:radius)
{
CheckpointX[playerid] = X;
CheckpointY[playerid] = Y;
CheckpointZ[playerid] = Z;
CheckpointR[playerid] = radius;
IgracevCPPrikazan[playerid] = true;
SetPlayerCheckpoint(playerid, X, Y, Z, radius);
return 1;
}
stock h_DisablePlayerCheckpoint(playerid)
{
CheckpointX[playerid] = 0.0000;
CheckpointY[playerid] = 0.0000;
CheckpointZ[playerid] = 0.0000;
CheckpointR[playerid] = 0.0000;
IgracevCPPrikazan[playerid] = false;
return DisablePlayerCheckpoint(playerid);
}
Hvala na ispravci,i sam sam danas skontao,ali zaboravio ovde editovati,inace bas mi je trebala komanda prosle godine i nikako nisam znao napraviti.
@TheTorreto nista, samo sljedeci put malo vise pripazi i to je to :) da se ovdje ne stvara spam zbog ispravki...
Citat: domo101 poslato Jul 18, 2015, 13:37:53 POSLE PODNE
CMD:agiveweapon(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 6) return SCM(playerid, -1, ""ZUTA"[BGR] "BIJELA"Samo Admini (Admin Level 6+)!");
new pplayerid,gun,ammo,string[128];
if(sscanf(params, "uii", pplayerid,gun,ammo)) return SCM(playerid,-1, ""ZUTA"BGR Pomoc | "BIJELA"/agiveweapon [ID/Nick] [Weapon ID] [Municija]");
if(pplayerid == IPI) return SCM(playerid, -1, "[BGR] "CRVENA"Taj igrac nije na serveru!");
g_GivePlayerWeapon(pplayerid, gun,ammo);
format(string,sizeof(string),""ZUTA"[BGR] "BIJELA"Admin "CRVENA"%s "BIJELA"vam je dao oruzije ID "SPLAVA"%d!",GetName(playerid),gun);
SCM(pplayerid,-1,string);
format(string,sizeof(string),""ZUTA"[BGR] "BIJELA"Dali ste oruzije ID "CRVENA"%d "BIJELA"igracu "SPLAVA"%s!",gun,GetName(pplayerid));
SCM(playerid,-1,string);
return 1;
}
Eto jedna koju sam ja koristio za svoj gm (Balkan Gaming Roleplay | American Cities Roleplay)
to ne služi niÄemu. zaÅ¡to? odakle ljudima te tvoje definicije sve?
= Komanda /zivot =
Komanda:
CMD:zivot(playerid,params[])
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid,-1,"{F81414}ERROR: Nemate dovoljno novaca."); //Provjerava ima li igraÄ dovoljno novaca kod sebe (postavljeno je na 500$), ako nema Å¡alje mu poruku da nema dovoljno novaca.
SetPlayerHealth(playerid, 100.0); //Postavlja igraÄu život na 100.
SendClientMessage(playerid,-1,"{00FF00}#INFO: UspjeÅ¡no ste se izlijeÄili.");//Å alje igraÄu poruku da se uspjeÅ¡no izlijeÄio.
return 1;
}
Komentar:Ovo je osnovna komanda namjenjena poÄetnicima u skriptanju, sve je objaÅ¡njeno. :-*
Evo od mene nesto :)
[pawn]
YCMD:selfie(playerid,params[],help)
{
#pragma unused help
if(UlogovanIgrac[playerid] == 0 || PI[playerid][pReg] == 0) return Error(playerid, "Nisi ulogovan/a ili nisi registrovan/a!");
if(PI[playerid][pAdmin] < 1 && ACCmd[playerid] == 1) return Error(playerid, "Komande mozete koristiti svakih 0.5sec!");
CmdProtect(playerid);
if(vulkanizer[playerid] == 1) return true;
if(VecUcitavaju[playerid] == 1) return true;
if(IsPlayerInAnyVehicle(playerid)) return Error(playerid, "Ne mozes u vozilu ovo!");
if(PI[playerid][pJailTime] > 0) return Error(playerid, "Ne mozes to u zatvoru!");
if(PljackaVreme[playerid] > 0 || ZauzimanjeVreme[playerid] > 0 || Tazovan[playerid] > 0 || Zavezan[playerid] > 0 || Tie[playerid] > 0) return Error(playerid, "Ne mozes to!");
if(PI[playerid][pMobilni] == 0) return Error(playerid, "Nemate mobilni telefon!");
if(PI[playerid][pSurvivor] > 0) return Error(playerid, "Na survivoru si, ne mozes to!");
if(PisanjeJok[playerid] == 1) return Error(playerid, "Ne mozes to u ovom trenutku!");
if(drogaz[playerid] == 1) return Error(playerid, "Trenutno si u efektu droge!");
if(kLol[playerid] > 0) return Error(playerid, "Ne mozete to!");
if(Zavezan[playerid] > 0 || Tie[playerid] > 0 || Tazovan[playerid] > 0) return Error(playerid, "Ne mozete to dok ste zavezani/sokirani! (zbog psovanja)");
if(TV[playerid] == 1) return Error(playerid, "Gledas tv, ne mozes to!");
if(PI[playerid][pTogPhone] == 1) return Error(playerid, "Nije ti upaljen telefon!");
if(PI[playerid][pRanjen] == 1) return Error(playerid, "Ne mozes to, ranjen si!");
if(takingselfie[playerid] == 0)
{
GetPlayerPos(playerid,lX[playerid],lY[playerid],lZ[playerid]);
static Float: n1X, Float: n1Y;
if(Degree[playerid] >= 360) Degree[playerid] = 0;
Degree[playerid] += Speed;
n1X = lX[playerid] + Radius * floatcos(Degree[playerid], degrees);
n1Y = lY[playerid] + Radius * floatsin(Degree[playerid], degrees);
SetPlayerCameraPos(playerid, n1X, n1Y, lZ[playerid] + Height);
SetPlayerCameraLookAt(playerid, lX[playerid], lY[playerid], lZ[playerid]+1);
SetPlayerFacingAngle(playerid, Degree[playerid] - 90.0);
lz_TogglePlayerControllable(playerid, 0);
takingselfie[playerid] = 1;
ApplyAnimation(playerid, "PED", "gang_gunstand", 4.1, 1, 1, 1, 1, 1, 1);
SCM(playerid, -1, "{C3C3C3}SERVER: {FFFFFF}Trenutno si u modu slikanja selfie-a!");
SCM(playerid, -1, "Pritisni: F8 - kada budes bio spreman da slikas selfie");
SCM(playerid, -1, " F7 - da iskljucis chat");
SCM(playerid, -1, " NUM6/NUM4 - da pomeras kameru.");
SCM(playerid, -1, "Upisi: /tog hud - da iskljucis textdrawove");
SCM(playerid, -1, " /headmove - da iskljucis mrdanje glave");
SCM(playerid, -1, " /selfie - da izadjes iz selfie moda.");
}
else if(takingselfie[playerid] == 1)
{
lz_TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
takingselfie[playerid] = 0;
StopLoopingAnim(playerid);
}
return true;
}[/pawn]
Citat: TiXoR_ poslato Jul 18, 2015, 13:39:21 POSLE PODNE
Citat: #Gimmyxa poslato Maj 11, 2016, 12:37:13 POSLE PODNE
Evo od mene nesto :)
[pawn]
YCMD:selfie(playerid,params[],help)
{
#pragma unused help
if(UlogovanIgrac[playerid] == 0 || PI[playerid][pReg] == 0) return Error(playerid, "Nisi ulogovan/a ili nisi registrovan/a!");
if(PI[playerid][pAdmin] < 1 && ACCmd[playerid] == 1) return Error(playerid, "Komande mozete koristiti svakih 0.5sec!");
CmdProtect(playerid);
if(vulkanizer[playerid] == 1) return true;
if(VecUcitavaju[playerid] == 1) return true;
if(IsPlayerInAnyVehicle(playerid)) return Error(playerid, "Ne mozes u vozilu ovo!");
if(PI[playerid][pJailTime] > 0) return Error(playerid, "Ne mozes to u zatvoru!");
if(PljackaVreme[playerid] > 0 || ZauzimanjeVreme[playerid] > 0 || Tazovan[playerid] > 0 || Zavezan[playerid] > 0 || Tie[playerid] > 0) return Error(playerid, "Ne mozes to!");
if(PI[playerid][pMobilni] == 0) return Error(playerid, "Nemate mobilni telefon!");
if(PI[playerid][pSurvivor] > 0) return Error(playerid, "Na survivoru si, ne mozes to!");
if(PisanjeJok[playerid] == 1) return Error(playerid, "Ne mozes to u ovom trenutku!");
if(drogaz[playerid] == 1) return Error(playerid, "Trenutno si u efektu droge!");
if(kLol[playerid] > 0) return Error(playerid, "Ne mozete to!");
if(Zavezan[playerid] > 0 || Tie[playerid] > 0 || Tazovan[playerid] > 0) return Error(playerid, "Ne mozete to dok ste zavezani/sokirani! (zbog psovanja)");
if(TV[playerid] == 1) return Error(playerid, "Gledas tv, ne mozes to!");
if(PI[playerid][pTogPhone] == 1) return Error(playerid, "Nije ti upaljen telefon!");
if(PI[playerid][pRanjen] == 1) return Error(playerid, "Ne mozes to, ranjen si!");
if(takingselfie[playerid] == 0)
{
GetPlayerPos(playerid,lX[playerid],lY[playerid],lZ[playerid]);
static Float: n1X, Float: n1Y;
if(Degree[playerid] >= 360) Degree[playerid] = 0;
Degree[playerid] += Speed;
n1X = lX[playerid] + Radius * floatcos(Degree[playerid], degrees);
n1Y = lY[playerid] + Radius * floatsin(Degree[playerid], degrees);
SetPlayerCameraPos(playerid, n1X, n1Y, lZ[playerid] + Height);
SetPlayerCameraLookAt(playerid, lX[playerid], lY[playerid], lZ[playerid]+1);
SetPlayerFacingAngle(playerid, Degree[playerid] - 90.0);
lz_TogglePlayerControllable(playerid, 0);
takingselfie[playerid] = 1;
ApplyAnimation(playerid, "PED", "gang_gunstand", 4.1, 1, 1, 1, 1, 1, 1);
SCM(playerid, -1, "{C3C3C3}SERVER: {FFFFFF}Trenutno si u modu slikanja selfie-a!");
SCM(playerid, -1, "Pritisni: F8 - kada budes bio spreman da slikas selfie");
SCM(playerid, -1, " F7 - da iskljucis chat");
SCM(playerid, -1, " NUM6/NUM4 - da pomeras kameru.");
SCM(playerid, -1, "Upisi: /tog hud - da iskljucis textdrawove");
SCM(playerid, -1, " /headmove - da iskljucis mrdanje glave");
SCM(playerid, -1, " /selfie - da izadjes iz selfie moda.");
}
else if(takingselfie[playerid] == 1)
{
lz_TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
takingselfie[playerid] = 0;
StopLoopingAnim(playerid);
}
return true;
}[/pawn]
to ne služi niÄemu. zaÅ¡to? odakle ljudima te tvoje definicije sve?
Tixor objasnio gore već :)
new bool:Names[MAX_PLAYERS];
NA VRH SKRIPTE
YCMD:names(playerid, params[], help)
{
Names[playerid] = !Names[playerid];
for(new i;i<MAX_PLAYERS;i++)
{
ShowPlayerNameTagForPlayer(playerid,i,Names[playerid]);
}
if(Names[playerid]) SendClientMessage(playerid,-1,"Nametags su ukljuceni!");
else SendClientMessage(playerid,-1,"Nametags su iskljuceni!");
return 1;
}
Nasao sam ovo u strcmp pa sam preveo i prilagodio,nisam ja sklapao kod samo sam preveo i dao ovamo.
Evo neÅ¡to jednostavno,portanje administracije do igraÄa.
[pawn]
stock Ime(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
return pName;
}
stock ImeIgraca(id)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(id, pName, sizeof(pName));
return pName;
}
YCMD:idido(playerid, params[], help)
{
#pragma unused help
if(PlayerInfo[playerid][pAdmin] > 0 || PlayerInfo[playerid][pGM] > 0 || IsPlayerAdmin(playerid))
{
new id, string1[128], string2[128];
new Float: x, Float: y, Float: z;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "Koristi: /ididi [id/deo imena]");
else
{
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Taj igrac je offline.");
GetPlayerPos(id, x, y, z);
SetPlayerPos(playerid, x, y+5, z);
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] == 6)
{
format(string1, sizeof(string1), "Head Admin %s se teleportovao do vas.", Ime(playerid));
}
else if(PlayerInfo[playerid][pAdmin] > 0 && PlayerInfo[playerid][pAdmin] < 6)
{
format(string1, sizeof(string1), "Admin %s se teleportovao do vas.", Ime(playerid));
}
else if(PlayerInfo[playerid][pGM] > 0)
{
format(string1, sizeof(string1), "GameMaster %s se teleportovao do vas.", Ime(playerid));
}
SendClientMessage(id, -1, string1);
format(string2, sizeof(string2), "Teleportovali ste se do %s.", ImeIgraca(id));
SendClientMessage(playerid, -1, string2);
}
}
else return SendClientMessage(playerid, -1, "Nemate ovlascenje za koriscenje ove komande.");
return 1;
}[/pawn]
Ovo vam je komanda za stit, korisno za Policiju. tj. RP servere
Prvi put da radim sa Attach objektima.
Na vrhu skripte gde su boje.
[pawn]#define ZUTA 0xFFFF00FF[/pawn]
Tamo gde su vam komande dodate ovo:
[pawn] CMD:pdstit(playerid, params[])
{
#pragma unused params
SCM(playerid, ZUTA, "Stavio si stit");
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
//AttachObjectCorrectly(playerid, 18637);
SetPlayerAttachedObject(playerid, 1, 18637, 5, -0.064955, -0.135697, -0.200892, 54.463840, 10.984453, 87.706436, 1.078429, 1.000000, 1.000000 );
return 1;
}[/pawn]
[pawn] CMD:skinistit(playerid, params[],help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1); // skida igracu stit
return 1;
}[/pawn]
POTREBNA MI JE KOMANDA ZA /CHANGENAME da radi YCMD
Komanda da pustate IG pesme sa youtuba
[pawn] CMD:playyt( playerid, params[] ) {
if( PlayerInfo[ playerid ][ xAdmin ] < 7 ) return GRESKA( playerid, "Nisi ovlascen da koristis ovu komandu!" );
if( !AdminDuty[ playerid ] ) return GRESKA( playerid, "Da bi koristili ovu komandu morate biti na duznosti." );
if( isnull( params ) ) return Usage( playerid, "/playyt [ YouTube URL ]" );
format( params, 145, "http://www.youtubeinmp3.com/fetch/?video=%s", params );
foreach( Player, i ) {
StopAudioStreamForPlayer( i );
PlayAudioStreamForPlayer( i, params );
}
format( globalstring, sizeof( globalstring ), ""col_red"[YOUTUBE]: "col_white"%s je pustio pesmu, da je ugasis - /stopmusic", ImeIgraca( playerid ) );
SCMA( -1, globalstring );
return 1;
} [/pawn]
Za stopiranje muzike
[pawn]CMD:stopmusic( playerid, params[] ) {
StopAudioStreamForPlayer( playerid );
Info( playerid, "Ugasio si pjesmu." );
return 1;
} [/pawn]
Treba mi /tdoff komanda u YCMD
Citat: Ur®Osâ,,¢ poslato Maj 05, 2017, 16:13:33 POSLE PODNE
Treba mi /tdoff komanda u YCMD
[pawn]
YCMD:tdoff(playerid,params[],help)
{
TextDrawHideForPlayer(playerid, IME TD-a);
return 1;
}[/pawn]
Citat: Arkoo poslato Maj 05, 2017, 16:57:50 POSLE PODNE
Citat: Ur®Osâ,,¢ poslato Maj 05, 2017, 16:13:33 POSLE PODNE
Treba mi /tdoff komanda u YCMD
[pawn]
YCMD:tdoff(playerid,params[],help)
{
TextDrawHideForPlayer(playerid, IME TD-a);
return 1;
}[/pawn]
Hvala al ovo playerid, IME TD-a tu upisem ime tda koji da se ugasi
Jel ima neko komandu /promoterplata al da je u YCMD :D
Citat: Ur®Osâ,,¢ poslato Maj 05, 2017, 17:10:20 POSLE PODNE
Jel ima neko komandu /promoterplata al da je u YCMD :D
[pawn]YCMD:promoterplata(playerid, params[],params)
{
new iznos;
if(sscanf(params, "i", iznos)) return SendClientMessage(playerid,-1,"(greska) /promoterplata (iznos novca)");
foreach(Player,i)
{
if(PlayerInfo
[pPromoter])
{
GivePlayerMoney(i,iznos);
}
}
return 1;
}[/pawn] Trebalo bi da radi :) prilagodi varijable prema svom modu
Evo komanda za kreiranje admin vozila, uzivajte! :)
[pawn]//============================================================================== INCLUDE
#include <YSI\y_hooks>
#include <zcmd>
#include <sscanf2>
//============================================================================== DEFINICIJE
new AdminVozilo[MAX_PLAYERS];
//============================================================================== ONPLAYERCONNECT
public OnPlayerConnect(playerid)
{
AdminVozilo[playerid] = 0;
return 1;
}
//============================================================================== ONPLAYERDISCONNECT
public OnPlayerDisconnect(playerid, reason)
{
if(AdminVozilo[playerid] == 1)
{
AdminVozilo[playerid] = 0;
DestroyVehicle(AdminVozilo[playerid]);
}
return 1;
}
//============================================================================== KOMANDA ZA CREATE VOZILA
CMD:aveh(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
new Float:x, Float:y, Float:z, id;
if(sscanf(params, "i", id)) return SendClientMessage(playerid, -1, "/aveh [id modela]");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Ne mozete koristiti ovu komandu dok ste u vozilu.");
if(id < 400 || id > 611 ) return SendClientMessage(playerid, -1, "ID modela moze iznositi od 400 do 611.");
if(IsPlayerAdmin(playerid) && id == 520) return SendClientMessage(playerid, -1, "Ne mozete vise stvarati HYDRU!!!");
GetPlayerPos(playerid, x, y, z);
if(AdminVozilo[playerid] > 0)
{
DestroyVehicle(AdminVozilo[playerid]); AdminVozilo[playerid] = 0;
AdminVozilo[playerid] = CreateVehicle(id, x, y, z, 0.000, random(6), random(6), 30000);
PutPlayerInVehicle(playerid, AdminVozilo[playerid], 0);
SendClientMessage(playerid, -1, "Uspesno ste stvorili privremeno vozilo.");
}
else
{
AdminVozilo[playerid] = CreateVehicle(id, x, y, z, 0.000, random(6), random(6), 30000);
PutPlayerInVehicle(playerid, AdminVozilo[playerid], 0);
SendClientMessage(playerid, -1, "Uspesno ste stvorili privremeno vozilo.");
}
}
else return SendClientMessage(playerid, -1, "Nemate dozvolu za koriscenje ove komande.");
return 1;
}
//============================================================================== KOMANDA ZA DESTROY VOZILA
CMD:destroyaveh(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(AdminVozilo[playerid] == 0) return SendClientMessage(playerid, -1, "Nisi kreirao Admin vozilo te ga ne mozes ukloniti.");
DestroyVehicle(AdminVozilo[playerid]);
AdminVozilo[playerid] = 0;
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, -1, "Uspesno ste uklonili privremeno vozilo.");
}
else return SendClientMessage(playerid, -1, "Nemate dozvolu za koriscenje ove komande.");
return 1;
}
//==============================================================================
[/pawn]
Citat: RESPOSNE poslato Maj 13, 2017, 19:50:39 POSLE PODNE
Evo komanda za kreiranje admin vozila, uzivajte! :)
[pawn]//============================================================================== INCLUDE
#include <YSI\y_hooks>
#include <zcmd>
#include <sscanf2>
//============================================================================== DEFINICIJE
new AdminVozilo[MAX_PLAYERS];
//============================================================================== ONPLAYERCONNECT
public OnPlayerConnect(playerid)
{
AdminVozilo[playerid] = 0;
return 1;
}
//============================================================================== ONPLAYERDISCONNECT
public OnPlayerDisconnect(playerid, reason)
{
if(AdminVozilo[playerid] == 1)
{
AdminVozilo[playerid] = 0;
DestroyVehicle(AdminVozilo[playerid]);
}
return 1;
}
//============================================================================== KOMANDA ZA CREATE VOZILA
CMD:aveh(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
new Float:x, Float:y, Float:z, id;
if(sscanf(params, "i", id)) return SendClientMessage(playerid, -1, "/aveh [id modela]");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Ne mozete koristiti ovu komandu dok ste u vozilu.");
if(id < 400 || id > 611 ) return SendClientMessage(playerid, -1, "ID modela moze iznositi od 400 do 611.");
if(IsPlayerAdmin(playerid) && id == 520) return SendClientMessage(playerid, -1, "Ne mozete vise stvarati HYDRU!!!");
GetPlayerPos(playerid, x, y, z);
if(AdminVozilo[playerid] > 0)
{
DestroyVehicle(AdminVozilo[playerid]); AdminVozilo[playerid] = 0;
AdminVozilo[playerid] = CreateVehicle(id, x, y, z, 0.000, random(6), random(6), 30000);
PutPlayerInVehicle(playerid, AdminVozilo[playerid], 0);
SendClientMessage(playerid, -1, "Uspesno ste stvorili privremeno vozilo.");
}
else
{
AdminVozilo[playerid] = CreateVehicle(id, x, y, z, 0.000, random(6), random(6), 30000);
PutPlayerInVehicle(playerid, AdminVozilo[playerid], 0);
SendClientMessage(playerid, -1, "Uspesno ste stvorili privremeno vozilo.");
}
}
else return SendClientMessage(playerid, -1, "Nemate dozvolu za koriscenje ove komande.");
return 1;
}
//============================================================================== KOMANDA ZA DESTROY VOZILA
CMD:destroyaveh(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(AdminVozilo[playerid] == 0) return SendClientMessage(playerid, -1, "Nisi kreirao Admin vozilo te ga ne mozes ukloniti.");
DestroyVehicle(AdminVozilo[playerid]);
AdminVozilo[playerid] = 0;
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, -1, "Uspesno ste uklonili privremeno vozilo.");
}
else return SendClientMessage(playerid, -1, "Nemate dozvolu za koriscenje ove komande.");
return 1;
}
//==============================================================================
[/pawn]
Veoma na laksi i bolji nacin se ovo moze uraditi
Jednostavna komanda za setovanje admina.. Nisam je uradio ja ceo da se zna odmah.. :)
[pawn]// SYSTEM BY RESPONSE ;)
// UZIVAJTE !
//============================================================================== INCLUDE
#include <YSI\y_ini>
#include <zcmd>
#include <sscanf2>
//============================================================================== DEFINE
#define ADMIN_FILE "Admini/A_%d.ini" // ADMIN FILE, KADA SE SETA ADMIN DA CUVA FILE ADMINA U SCRIPTFILES POD "ADMINI"
#define MAX_ADMIN 10 // MAX ADMINA KOLIKO MOZE DA SE SETA
//============================================================================== DEFINE ZA PRIVATE
#define private%0(%1) forward%0(%1); \
public%0(%1) // OVO SAM URADIO PO MOME, VI SAMO MESTO PRIVATE STAVITE FORWARD I PUBLIC.
//============================================================================== ENUM ZA DIALOGE
enum
{
DIALOG_ADMINSET // ZA DIALOG DOLE KADA SE SETA ADMIN
}
//============================================================================== ENUM ZA PINFO
enum pInfo // PLAYERINFO TO VEC SVI ZNAMO
{
pAdmin, // NAPOMENA: OVO PODESITE NA VASEM MODU KAKO JE URADJENO!
pAdminSlot, // NAPOMENA: OVO PODESITE NA VASEM MODU KAKO JE URADJENO!
pStaffCode // NAPOMENA: OVO PODESITE NA VASEM MODU KAKO JE URADJENO!
}
new PlayerInfo[MAX_PLAYERS][pInfo];
//============================================================================== UCITAVANJE IGRACA
private UcitajIgraca(igrac_id, name[], value[]) // UCITAVA ADMINA
{
INI_Int("Admin", PlayerInfo[igrac_id][pAdmin]);
INI_Int("AdminSlot", PlayerInfo[igrac_id][pAdminSlot]);
INI_Int("StaffCode", PlayerInfo[igrac_id][pStaffCode]);
return 1;
}
//============================================================================== CUVANJE IGRACA
stock SacuvajAdmina(igrac_id) // CUVAJ ADMINA
{
new INI:IFile = INI_Open(IGRAC_FILE);
INI_Int(IFile, "Admin", PlayerInfo[igrac_id][pAdmin]);
INI_Int(IFile, "AdminSlot", PlayerInfo[igrac_id][pAdminSlot]);
INI_Int(IFile, "StaffCode", PlayerInfo[igrac_id][pStaffCode]);
INI_Close(igrac_id);
return 1;
}
//============================================================================== KOMANDA ZA SETOVANJE ADMINA
command(makeadmin, playerid, params[]) // BY RESPONSE ;)
{
new idigraca, level, slot;
if(sscanf(params, "ui", idigraca, level, slot))
return SendClientMessage(playerid, -1, "/makeadmin [Ime_Prezime/ID] [0-6] [0-10]"); // KOMANDA ZA SETANJE ADMINA PRIMER: /MAKEADMIN RESPONSE 6 1 (IME: RESPONSE ALEVEL: 6 SLOT: 1);
if(idigraca == INVALID_PLAYER_ID)
return SendClientMessage(playerid, -1, "Igrac nije konektovan!"); // GOVORI DA IGRAC NIJE KONEKTOVAN ILI JE POGRESAN ID;
if(level < 0 || level > 6)
return SendClientMessage(playerid, -1, "/makeadmin [Ime_Prezime/ID] [0-6] [0-10]");
SetAdmin(idigraca, playerid, level, slot, 1000 + random(9999)); // SETA ADMINA IGRACU (ALEVEL, SLOT, KOD);
return 1;
}
//============================================================================== STOCK ZA IME_IGRACA
stock GetName(playerid)
{
new Ime_Igraca[MAX_PLAYER_NAME];
GetPlayerName(playerid, Ime_Igraca, MAX_PLAYER_NAME);
return Ime_Igraca;
}
//============================================================================== STOCK ZA SET ADMINA PORUKU
stock SetAdmin(igrac, giverid, level, slot, akod) // BY RESPONSE ;)
{
new string[1500];
if(level == 0)
{
format(string, sizeof(string), "Admin %s vam je skinuo admin poziciju.", GetName(giverid));
SendClientMessage(igrac, -1, string); // DAJE PORUKU IGRACU DA MU JE SKINUT ADMIN
format(string, sizeof(string), "Uspesno ste skinuli admin poziciju igracu %s.", GetName(igrac));
SendClientMessage(giverid, -1, string); // DAJE PORUKU ADMINU KOJEM JE SKINUO IGRACU ADMINA
// SETA ADMIN LEVEL NA 0 // SETA ADMIN SLOT NA 0 // SETA ADMIN KOD NA 0 // < STAVLJENO JE NA 0 POSTO JE SKINUT ADMIN IGRACU
PlayerInfo[igrac][pAdmin] = 0; PlayerInfo[igrac][pAdminSlot] = 0; PlayerInfo[igrac][pStaffCode] = 0;
}
else
{
// SETA ADMIN LEVEL // SETA ADMIN SLOT // SETA ADMIN KOD
PlayerInfo[igrac][pAdmin] = level; PlayerInfo[igrac][pAdminSlot] = slot; PlayerInfo[igrac][pStaffCode] = akod;
format(string, sizeof(string), "{066FDE}OBAVESTENJE:\n\
{FFFFFF}Admin {066FDE}%s {FFFFFF}vam je postavio admin poziciju.\n\
{FFFFFF}Dobili ste svoj Staff(CODE) sve ce vam dole biti objasnjeno.\n\n\
{066FDE}VAZNO:\n\
{FFFFFF}Bez ovog koda necete moci da upravljate staff komandama.\n\
{FFFFFF}CODE:{066FDE} (%d) - {FFFFFF}LEVEL:{066FDE} (%d) - {FFFFFF}SLOT:{066FDE} (%d).", GetName(giverid), akod, level, slot);
ShowPlayerDialog(igrac, DIALOG_ADMINSET, DIALOG_STYLE_MSGBOX, "ADMINISTRATOR - POZICIJA", string, "UREDU", "IZLAZ");
}
return 1;
}
//==============================================================================
[/pawn]
Ima neko komandu /izbrisi (kucu,stan,vikendicu)ili ako neko zna dali ime u nekom modu zz
Citat: Joca200 poslato Maj 23, 2017, 18:40:07 POSLE PODNE
Ima neko komandu /izbrisi (kucu,stan,vikendicu)ili ako neko zna dali ime u nekom modu zz
Evo ti primjer:
[pawn]YCMD:izbrisivikendicu(playerid, params[], help)
{
if(!IsPlayerAdmin(playerid)) return SCM(playerid,-1, "Nemate ovlastenje za upotrebu ove komande!");
new vFile[50],id;
if(sscanf(params,"i",id)) return SCM(playerid, -1, "/izbrisivikendicu [ID]");
format(vFile, sizeof(vFile), VIKENDICA_FILE, id);
if(fexist(vFile)){ fremove(vFile); Delete3DTextLabel(VikendicaLabel[id]); DestroyPickup(VikendicaPickup[id]); }
else { SCM(playerid,-1,"Taj ID Vikendice ne postoji!"); }
return 1;
}[/pawn]
Citat: RESPOSNE poslato Maj 13, 2017, 19:50:39 POSLE PODNE
Evo komanda za kreiranje admin vozila, uzivajte! :)
[pawn]
public OnPlayerDisconnect(playerid, reason)
{
if(AdminVozilo[playerid] == 1)
{
AdminVozilo[playerid] = 0;
DestroyVehicle(AdminVozilo[playerid]);
}
return 1;
}[/pawn]
Mislim da ti OnPlayerDisconnect nece funkcionirati jer se prebaci AdminVozilo na 0 pa se zatim unisti, znaci kod glasi DestroyVehicle(0);
"Komanda za vrijeme", nista posebno, valjace nekima.. Ima pocetnika koji ne znaju ni ovo da urade tako da se nadam da sam im pomogao. :)
[pawn]YCMD:time(playerid, params[], help) {
new sati, minute, sekunde, kurac;
kurac = gettime(sati, minute, sekunde);
new string[64];
format(string, 64, ""COL_BE"[Monaco] "BELA"Sada je %02d:%02d:%02d.", sati, minute, sekunde);
SCM(playerid, -1, string);
return 1;[/pawn]
Evo kako "ispadne" in game. (ovo sam radio u balkan esotic modu, tako da vi prilagodite sebi neke stvari..)
(http://noobot.info/uploader/image.php?di=QKK1)
Citat: anDro_ poslato Jun 10, 2017, 18:00:50 POSLE PODNE
"Komanda za vrijeme", nista posebno, valjace nekima.. Ima pocetnika koji ne znaju ni ovo da urade tako da se nadam da sam im pomogao. :)
[pawn]YCMD:time(playerid, params[], help) {
new sati, minute, sekunde, kurac;
kurac = gettime(sati, minute, sekunde);
new string[64];
format(string, 64, ""COL_BE"[Monaco] "BELA"Sada je %02d:%02d:%02d.", sati, minute, sekunde);
SCM(playerid, -1, string);
return 1;[/pawn]
Evo kako "ispadne" in game. (ovo sam radio u balkan esotic modu, tako da vi prilagodite sebi neke stvari..)
(http://noobot.info/uploader/image.php?di=QKK1)
hahahahaha new kurac
Dobro izgleda
Citat: Bašovski poslato Jun 10, 2017, 20:10:56 POSLE PODNE
Citat: anDro_ poslato Jun 10, 2017, 18:00:50 POSLE PODNE
"Komanda za vrijeme", nista posebno, valjace nekima.. Ima pocetnika koji ne znaju ni ovo da urade tako da se nadam da sam im pomogao. :)
[pawn]YCMD:time(playerid, params[], help) {
new sati, minute, sekunde, kurac;
kurac = gettime(sati, minute, sekunde);
new string[64];
format(string, 64, ""COL_BE"[Monaco] "BELA"Sada je %02d:%02d:%02d.", sati, minute, sekunde);
SCM(playerid, -1, string);
return 1;[/pawn]
Evo kako "ispadne" in game. (ovo sam radio u balkan esotic modu, tako da vi prilagodite sebi neke stvari..)
(http://noobot.info/uploader/image.php?di=QKK1)
hahahahaha new kurac
Dobro izgleda
Logicno kad ja radim :3 falenzi. :D
Super :D
Citat: anDro_ poslato Jun 10, 2017, 18:00:50 POSLE PODNE
"Komanda za vrijeme", nista posebno, valjace nekima.. Ima pocetnika koji ne znaju ni ovo da urade tako da se nadam da sam im pomogao. :)
[pawn]YCMD:time(playerid, params[], help) {
new sati, minute, sekunde, kurac;
kurac = gettime(sati, minute, sekunde);
new string[64];
format(string, 64, ""COL_BE"[Monaco] "BELA"Sada je %02d:%02d:%02d.", sati, minute, sekunde);
SCM(playerid, -1, string);
return 1;[/pawn]
Evo kako "ispadne" in game. (ovo sam radio u balkan esotic modu, tako da vi prilagodite sebi neke stvari..)
(http://noobot.info/uploader/image.php?di=QKK1)
[pawn]Ima pocetnika koji ne znaju ni ovo da urade tako da se nadam da sam im pomogao.[/pawn]
[pawn]CMD:time(playerid, params[])
{
new sati, minute, string[20];
gettime(sati, minute);
format(string, sizeof(string), "Sada je %02d:%02d", sati, minute);
SendClientMessage(playerid, -1, string);
return 1;
}
[/pawn]
A i nkntm koji ce im kurac kad imaju - /timestamp
Citat: Åukmember=1996][/member] link=topic=7222.msg733778#msg733778 date=1497130867]
Citat: anDro_ poslato Jun 10, 2017, 18:00:50 POSLE PODNE
"Komanda za vrijeme", nista posebno, valjace nekima.. Ima pocetnika koji ne znaju ni ovo da urade tako da se nadam da sam im pomogao. :)
[pawn]YCMD:time(playerid, params[], help) {
new sati, minute, sekunde, kurac;
kurac = gettime(sati, minute, sekunde);
new string[64];
format(string, 64, ""COL_BE"[Monaco] "BELA"Sada je %02d:%02d:%02d.", sati, minute, sekunde);
SCM(playerid, -1, string);
return 1;[/pawn]
Evo kako "ispadne" in game. (ovo sam radio u balkan esotic modu, tako da vi prilagodite sebi neke stvari..)
(http://noobot.info/uploader/image.php?di=QKK1)
[pawn]Ima pocetnika koji ne znaju ni ovo da urade tako da se nadam da sam im pomogao.[/pawn]
[pawn]CMD:time(playerid, params[])
{
new sati, minute, string[20];
gettime(sati, minute);
format(string, sizeof(string), "Sada je %02d:%02d", sati, minute);
SendClientMessage(playerid, -1, string);
return 1;
}
[/pawn]
A i nkntm koji ce im kurac kad imaju - /timestamp
Ma ne zna svako za /timestamp :p
Evo jedne korisne komande za DM/RP servere.Ova komanda moze posluziti Admnima kako ih ne bi mogli ubiti.
Radjena je uz pomoc ZCMD.Potreban je i sscanf kako bi proverili da li je taj igrac koji koristi komandu admin.
[pawn]#include <zcmd>
#include <sscanf2>[/pawn]
Sada dodajte ovaj new:
[pawn]new God[MAX_PLAYERS] = 0;[/pawn]
Dalje radimo komandu, to ide ovako:
[pawn]CMD:adminhealth(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,CRVENA,"[GRESKA]:Morate biti Admin da bi koristili ovu komandu !");
else
{
if(God[playerid] == 1)
{
God[playerid] = 0;
SendClientMessage(playerid,NARANDZASTA,"[OBAVESTENJE]:Iskljucili ste Admin Health !");
SetPlayerHealth(playerid,100.0);
}
else
{
God[playerid] = 1;
SetPlayerHealth(playerid,1000.0);
SendClientMessage(playerid,NARANDZASTA,"[OBAVESTENJE]:Ukljucili ste Admin Health !");
}
}
return 1;
}[/pawn]
Sada u svom modu nadjite "public OnPlayerDeath(playerid, killerid, reason)" i tu dodajte sledece:
[pawn]public OnPlayerDeath(playerid, killerid, reason)
{
if(God[playerid] == 1)
{
God[playerid] = 0;
}
return 1;
}[/pawn]
Zatim dodajte ili ako imate nadjite OnPlayerUpdate(playerid) i tu upisite:
[pawn]public OnPlayerUpdate(playerid)
{
if(God[playerid] == 1)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 1000.0)
{
SetPlayerHealth(playerid, 1000.0);
}
}
return 1;
}[/pawn]
E to vam je ta komanda, uz pomoc nje, ako ste Admin ne mogu vas ubiti. :)
Citat: Zorz poslato Jul 10, 2017, 14:46:56 POSLE PODNE
Evo jedne korisne komande za DM/RP servere.Ova komanda moze posluziti Admnima kako ih ne bi mogli ubiti.
Radjena je uz pomoc ZCMD.Potreban je i sscanf kako bi proverili da li je taj igrac koji koristi komandu admin.
[pawn]#include <zcmd>
#include <sscanf2>[/pawn]
Sada dodajte ovaj new:
[pawn]new God[MAX_PLAYERS] = 0;[/pawn]
Dalje radimo komandu, to ide ovako:
[pawn]CMD:adminhealth(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,CRVENA,"[GRESKA]:Morate biti Admin da bi koristili ovu komandu !");
else
{
if(God[playerid] == 1)
{
God[playerid] = 0;
SendClientMessage(playerid,NARANDZASTA,"[OBAVESTENJE]:Iskljucili ste Admin Health !");
SetPlayerHealth(playerid,100.0);
}
else
{
God[playerid] = 1;
SetPlayerHealth(playerid,1000.0);
SendClientMessage(playerid,NARANDZASTA,"[OBAVESTENJE]:Ukljucili ste Admin Health !");
}
}
return 1;
}[/pawn]
Sada u svom modu nadjite "public OnPlayerDeath(playerid, killerid, reason)" i tu dodajte sledece:
[pawn]public OnPlayerDeath(playerid, killerid, reason)
{
if(God[playerid] == 1)
{
God[playerid] = 0;
}
return 1;
}[/pawn]
Zatim dodajte ili ako imate nadjite OnPlayerUpdate(playerid) i tu upisite:
[pawn]public OnPlayerUpdate(playerid)
{
if(God[playerid] == 1)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 1000.0)
{
SetPlayerHealth(playerid, 1000.0);
}
}
return 1;
}[/pawn]
E to vam je ta komanda, uz pomoc nje, ako ste Admin ne mogu vas ubiti. :)
Moze ovo veoma jednostavnije ako se ne varam
Samo onplayertakeshoot (tako nesto se zove callback), i samo ako je taj koga puca admin, da ne skida adminu health, samo da mu svaki put kad ga puca stavi mu na 100 lol
Ne znam, verovatno moze jednostavnije, ali ja znam za ovaj nacin i radi, u medjuvremenu testirao sam ga i pod vodom, nije u pitanju samo ako te pucaju vec bio sta da ti skida helte(skocis sa neke visine, davis se pod vodom, puca te neko itd..) opet ti vraca helte na max.
Citat: TiXoR_ poslato Maj 22, 2011, 17:53:02 POSLE PODNE
Citat: eXtreme poslato Januar 26, 2011, 14:40:40 POSLE PODNE
Komanda:
CMD:me(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new
MeTxT,
string[180],
Ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, Ime, sizeof(Ime));
if(sscanf(params, "s", MeTxT)) return SendClientMessage(playerid, 0xFFFFFFFF, "[member=1996][/member] /me <TxT> [member=1996][/member]");
format(string, sizeof(string), "* %s %s", Ime, MeTxT);
ProxDetector(30, playerid, string, 0xFFFFFFFF, 0xEFEFEFFF, 0xDFDFDFFF, 0xCFCFCFFF, 0xBFBFBFFF);
}
return false;
}
Napomena: ZCMD i SSCANF :)
ProxDetector:
stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
return 1;
}
Ovo ne radi 8)
Stavi ovako:
CMD:me(playerid, params[])
{
new
s[80],
s1[180],
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
if(sscanf(params, "s", s)) return SendClientMessage(playerid, 0xFFFFFFFF, "[member=1996][/member] /me <TxT> [member=1996][/member]");
format(s1, sizeof(s1), "* %s %s", pName, s);
ProxDetector(30, playerid, s1, 0xFFFFFFFF, 0xEFEFEFFF, 0xDFDFDFFF, 0xCFCFCFFF, 0xBFBFBFFF);
return true;
}
Credits: Aleksandar
Kako definirati ProxDetector
[pawn]stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
return 1;
} [/pawn]
Citat: TiXoR_ poslato Septembar 09, 2017, 14:34:00 POSLE PODNE
[pawn]stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
return 1;
} [/pawn]
ima i laksih kodova, ovo niko ni ne koristi vise
Citat: Åukmember=1996][/member] link=topic=7222.msg758402#msg758402 date=1504992175]
Citat: TiXoR_ poslato Septembar 09, 2017, 14:34:00 POSLE PODNE
[pawn]stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
return 1;
} [/pawn]
ima i laksih kodova, ovo niko ni ne koristi vise
samo san mu kopira jer je oÄito slip jer mu piÅ¡e već u tom postu kojeg je citira..
Kako da stavim komandu /help to ne znam lol
Citat: Balsa. poslato Septembar 30, 2017, 22:48:36 POSLE PODNE
Kako da stavim komandu /help to ne znam lol
dialog samo napravis, imas tut na forumu.
Citat: z04k poslato Septembar 30, 2017, 22:51:36 POSLE PODNE
Citat: Balsa. poslato Septembar 30, 2017, 22:48:36 POSLE PODNE
Kako da stavim komandu /help to ne znam lol
dialog samo napravis, imas tut na forumu.
Ne nakupljaj postove bezveze, ovo je 4. put da to radis
Kreiraj komandu, definisi dialog, i pod onplayerdialogresponse stavis ako je dialog taj i taj sta ce da se desi, posjeti kampove za pawn skriptanje ;)
Citat: Åukmember=1996][/member] link=topic=7222.msg763836#msg763836 date=1506876365]
Citat: z04k poslato Septembar 30, 2017, 22:51:36 POSLE PODNE
Citat: Balsa. poslato Septembar 30, 2017, 22:48:36 POSLE PODNE
Kako da stavim komandu /help to ne znam lol
dialog samo napravis, imas tut na forumu.
Ne nakupljaj postove bezveze, ovo je 4. put da to radis
Kreiraj komandu, definisi dialog, i pod onplayerdialogresponse stavis ako je dialog taj i taj sta ce da se desi, posjeti kampove za pawn skriptanje ;)
Okej hvala,uspio sam