-
Posts
1.557 -
Joined
-
Last visited
-
Days Won
28
Content Type
Profiles
Forums
News
Documentation
Everything posted by Джо
-
In gamemode trebuie sa il pui la OnCommandRecived,sau in OnPlayerCommandText.
-
#include <a_samp> #include <sscanf2> #include <dini> #include <zcmd> #include <dfile> #define MAX_GPS_LOCATIONS 100 #define MAX_GPS_NAME_STRING 100 #define GPS_DIALOG 5900 #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_RED 0xAA3333AA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_BLUE 0x0000BBAA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_ORANGE 0xFF9900AA #define COLOR_RED 0xAA3333AA #define COLOR_LIME 0x10F441AA #define COLOR_MAGENTA 0xFF00FFFF #define COLOR_NAVY 0x000080AA #define COLOR_AQUA 0xF0F8FFAA #define COLOR_CRIMSON 0xDC143CAA #define COLOR_FLBLUE 0x6495EDAA #define COLOR_BISQUE 0xFFE4C4AA #define COLOR_BLACK 0x000000AA #define COLOR_CHARTREUSE 0x7FFF00AA #define COLOR_BROWN 0XA52A2AAA #define COLOR_CORAL 0xFF7F50AA #define COLOR_GOLD 0xB8860BAA #define COLOR_GREENYELLOW 0xADFF2FAA #define COLOR_INDIGO 0x4B00B0AA #define COLOR_IVORY 0xFFFF82AA #define COLOR_LAWNGREEN 0x7CFC00AA #define COLOR_SEAGREEN 0x20B2AAAA #define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime #define COLOR_MIDNIGHTBLUE 0X191970AA #define COLOR_MAROON 0x800000AA #define COLOR_OLIVE 0x808000AA #define COLOR_ORANGERED 0xFF4500AA #define COLOR_PINK 0xFFC0CBAA // - Light pink #define COLOR_SPRINGGREEN 0x00FF7FAA #define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... #define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green #define COLOR_MEDIUMAQUA 0x83BFBFAA #define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^ #define COLOR_GREY 0xAFAFAFAA new gpspos[MAX_PLAYERS][MAX_GPS_LOCATIONS][MAX_GPS_NAME_STRING]; new indexgps[MAX_PLAYERS]; public OnFilterScriptInit() { print("n--------------------------------------"); print(" This Gps is created by Kiburici!"); print("--------------------------------------n"); return 1; } public OnFilterScriptExit() { for(new i=0; i<=MAX_PLAYERS; i++) { indexgps = -1; for(new j=0; j<=MAX_GPS_LOCATIONS; j++) { for(new k=0; k<=MAX_GPS_NAME_STRING; k++) gpspos[j][k] = -1; } } return 1; } public OnPlayerConnect(playerid) { new pname[50],folder[100]; GetPlayerName(playerid,pname,sizeof(pname)); format(folder,sizeof(folder),"/gps/%s",pname); return 1; } public OnPlayerDisconnect(playerid, reason) { indexgps[playerid] = -1; for(new i=0; i<=MAX_GPS_LOCATIONS; i++) { for(new j=0; j<=MAX_GPS_NAME_STRING; j++) gpspos[playerid][j] = -1; } return 1; } CMD:newgpspos(playerid,params[]) { new placename[50],pname[50],file[100],Float:x,Float:y,Float:z; indexgps[playerid] = GetPlayerGPSFileCount(playerid); if(sscanf(params,"s",placename)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /newgpspos [PLACE NAME]"); GetPlayerName(playerid,pname,sizeof(pname)); GetPlayerPos(playerid,x,y,z); format(file,sizeof(file),"/gps/%s/%d.gps",pname,indexgps[playerid]); dini_Create(file); dini_Set(file,"Name",placename); dini_FloatSet(file,"PosX",x); dini_FloatSet(file,"PosY",y); dini_FloatSet(file,"PosZ",z); SendClientMessage(playerid,COLOR_GREEN,"Place added to your GPS. Use /gps to see."); return 1; } CMD:gps(playerid,params[]) { new pname[50],mstring[2000],str1[256],str2[260],file[100]; GetPlayerName(playerid,pname,sizeof(pname)); for(new i=0; i<=MAX_GPS_LOCATIONS; i++) { format(file,sizeof(file),"/gps/%s/%d.gps",pname,i); if(dini_Exists(file)) { str1 = dini_Get(file,"Name"); format(str2,sizeof(str2),"%sn",str1); strcat(mstring,str2); } } ShowPlayerDialog(playerid,GPS_DIALOG,DIALOG_STYLE_LIST,"GPS Locations",mstring,"OK","Cancel"); return 1; } public OnPlayerEnterCheckpoint(playerid) { DisablePlayerCheckpoint(playerid); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == GPS_DIALOG) { if(response == 1) { new pname[50],file[200],Float:px,Float:py,Float:pz,send[100]; GetPlayerName(playerid,pname,sizeof(pname)); format(file,sizeof(file),"/gps/%s/%d.gps",pname,listitem); px = dini_Float(file,"PosX"); py = dini_Float(file,"PosY"); pz = dini_Float(file,"PosZ"); SetPlayerCheckpoint(playerid,px,py,pz,3.0); format(send,sizeof(send),"Checkpoint made at %.2f %.2f %.2f",px,py,pz); SendClientMessage(playerid,COLOR_GREEN,send); return 1; } else { SendClientMessage(playerid,COLOR_RED,"You cancelled!"); return 1; } } return 0; } stock GetPlayerGPSFileCount(playerid) { new file[100],pname[50]; GetPlayerName(playerid,pname,sizeof(pname)); for(new i=0; i<=MAX_GPS_LOCATIONS; i++) { format(file,sizeof(file),"/gps/%s/%d.gps",pname,i); if(!dini_Exists(file)) { return i; } } return 1; }
-
Recompileaza GM-ul si porneste serverul,vezi daca tot iti zice asa.
-
Topic Closed.Inactiviate.
-
Ok,imi plac tutorialele tale,dar imi spui te rog de unde le copii?
-
Fiindca este in teste,chiar daca a fost lansat,o sa fie pus oficial cat de curand.
-
Deja depasesti probleme la Suport Servere.Asta e o problema legata de ajutor scripting.
-
Hmm,daca erai umpicut mai destept si aveai umpic de timp liber,puteai sa creezi un job de gunoier mai avansat,spre exemplu te plimbi prin oras iar unde gasesti gunoi(la case/restaurante) sa dai /picktrash sa il ia.In rest e facut bine. Ideea asta ce ti-am dat-o am facut-o eu...
-
Adauga daca nu ai deja la enum pInfo pGiftPoint, La OnPlayerRegister PlayerInfo[playerid][pGiftPoint] = 0; .Si schimba din PlayerInfo[playerid][pGiftPoint] = 0; in PlayerInfo[i][pGiftPoint] = 0;
-
La public Payday() pune PlayerInfo[playerid][pGiftPoint] = 0; Dar dupa acele mesaje cum ca ai luat payday-ul etc..
-
Frumos,pune cu cu
- 5 replies
-
- Tutoriale Limbaj PWN!
- TUTORIALE LEGENDS!
- (and 5 more)
-
Si de ce ma rog nu au aparut pe niciun site decat pe ala care la postat WopsS? http://www.k-dst.de/ In MAP EDITOR cand caut obiectele nu le gasesc.
-
Failed (plugins/mysql.so: symbol __cxa_pure_virtual, version libmysqlclient_16 not defined in file libmysqlclient_r.so.16 with link time reference) Updateaza mysql.so chiar daca s-a pornit cu succes.
-
Ok,intrebare: Gmul are peste 65k de linii? Ce ai adaugat ultima data inainte sa iti dea eroarea asta? Inlocuieste pawno-ul si vezi daca tot asa e.
-
Nup,am probat si obiectele in MAP EDITOR sa vad daca s-au adaugat,dar nu au fost inca adaugate.
-
Interesante chestiile astea 2: Adaugă zone cu prognoze meteo pentru Verona mall, LS Beachside, LS Apartament Building, LS Office Floors în fişierul SAMP/samp.ipl. Rezolvată o problema în RakNet care funcţiile NetStats_* nu pot fi utilizate în cazul în care ID-ul jucător nu a fost pe deplin conectat.
-
Salutare.In continuare o sa iti prezint cum sa faci un sistem de admin simplu. Mergi la enum pInfo sau daca ai enum pData Adaugi asta la OnPlayerConnect PlayerInfo[playerid][pAdmin] = 0; Acum iti voi da comanda /makeadmin. if(strcmp(cmd, "/makeadmin", true) == 0) { new string[128]; new tmp[256]; new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME]; new giveplayerid; if (IsPlayerAdmin(playerid))//Verifica daca playerul este logat la RCON. { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, ORANGE, "Folosire: /makeadmin [playerid] [level]"); SendClientMessage(playerid, ORANGE, "Functie:Da unui player admin."); return 1; } giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); new level = strval(tmp); if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, player, sizeof(player)); PlayerInfo[giveplayerid][AdminLevel] = level; printf("Admin %s >> %s admin level %d.", player, giveplayer, level); format(string, sizeof(string), "Ai primit admin level %d de la %s.", level, player); SendClientMessage(giveplayerid, 0x00C2ECFF, string); format(string, sizeof(string), "I-ai dat lui %s admin level %d.", giveplayer,PlayerInfo[giveplayerid][pAdmin]); SendClientMessage(playerid, 0x00C2ECFF, string); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), "%i nu este activ", giveplayerid); SendClientMessage(playerid, 0xE60000FF, string); } } else { SendClientMessage(playerid, 0xE60000FF, "Nu esti logat la RCON"); } return 1; }
-
Cumva ai in gm facut acest sistem? Si apropo,iti da banii si tii ia sau nu tii da deloc. Joci cu o anumita comanda sau intri intr-un checkpoint? Aveam si eu gm reaven's da nu aveam problema asta.
-
Topic Closed. Inactivitate topic.
-
Topic Closed. Inactivitate topic.
-
Daca ai SyncTime,poti sa il pui acolo.
-
if (strcmp(cmd, "/buygun", true) == 0) { if(IsPlayerConnected(playerid)) { if(!IsPlayerInRangeOfPoint(playerid, 7.0, 296.8718,-111.7265,1001.5156) && !IsPlayerInRangeOfPoint(playerid, 7.0, 2170.2781,1618.8182,999.9766)) { SendClientMessage(playerid, COLOR_GREY, " Nu esti la Ammunation sau GSLS!"); return 1; } if(GetPlayerMoney(playerid) < 1) { SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You dont have enough money with you !"); return 1; } if (PlayerInfo[playerid][pGunLic] < 1) { SendClientMessage(playerid, COLOR_WHITE, "[Eroare]: Nu detii licenta de arme !"); return 1; } new gun; new gunid[16]; new gunstring1[256]; new gunstring2[256]; new gunstring3[256]; new gunstring4[256]; new gunstring5[256]; new infostring[256]; new guncharge; new ammocharge; new location = PlayerInfo[playerid][pLocal]; if(location == 200 || location == 203) { if(BizzInfo[location-200][bProducts] <= 0) { GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1); return 1; } new mod2 = 100; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { format(string, sizeof(string), "{00A1FF}USAGE{FFFFFF}: /buygun [gunname] [ammoamount]"); SendClientMessage(playerid, COLOR_GREEN,"_______________________________________"); SendClientMessage(playerid, COLOR_WHITE,"*** Guns & Ammo ***"); SendClientMessage(playerid, COLOR_WHITE,string); format(gunstring1, 256, "Weapons: parachute (%s) golfclub (%s) nightstick (%s) baseballbat (%s) shovel (%s) poolcue (%s)", DecimalPoint(GunPrice[0][0]/100*mod2),DecimalPoint(GunPrice[1][0]/100*mod2),DecimalPoint(GunPrice[2][0]/100*mod2), DecimalPoint(GunPrice[3][0]/100*mod2),DecimalPoint(GunPrice[4][0]/100*mod2),DecimalPoint(GunPrice[5][0]/100*mod2),DecimalPoint(GunPrice[6][0]/100*mod2)); SendClientMessage(playerid, COLOR_WHITE, gunstring1); format(gunstring2, 256, "Weapons: purpledildo (%s) whitedildo (%s) longwhitedildo (%s) whitedildo2 (%s) flowers (%s) cane (%s)", DecimalPoint(GunPrice[7][0]/100*mod2),DecimalPoint(GunPrice[8][0]/100*mod2),DecimalPoint(GunPrice[9][0]/100*mod2), DecimalPoint(GunPrice[10][0]/100*mod2),DecimalPoint(GunPrice[11][0]/100*mod2),DecimalPoint(GunPrice[12][0]/100*mod2)); SendClientMessage(playerid, COLOR_WHITE, gunstring2); format(gunstring3, 256, "Weapons: sdpistol (%s) deagle (%s) mp5 (%s) shotgun (%s) ak47 (%s) m4 (%s) rifle (%s)", DecimalPoint(GunPrice[13][0]/100*mod2),DecimalPoint(GunPrice[14][0]/100*mod2),DecimalPoint(GunPrice[15][0]/100*mod2), DecimalPoint(GunPrice[16][0]/100*mod2),DecimalPoint(GunPrice[17][0]/100*mod2),DecimalPoint(GunPrice[18][0]/100*mod2), DecimalPoint(GunPrice[19][0]/100*mod2)); SendClientMessage(playerid, COLOR_WHITE, gunstring4); format(gunstring5, 256, "Weapons: pistolammo (%s) shotgunammo (%s) smgammo (%s) assaultammo (%s) rifleammo (%s)", DecimalPoint(GunPrice[25][0]/100*mod2),DecimalPoint(GunPrice[26][0]/100*mod2),DecimalPoint(GunPrice[27][0]/100*mod2), DecimalPoint(GunPrice[28][0]/100*mod2),DecimalPoint(GunPrice[29][0]/100*mod2)); SendClientMessage(playerid, COLOR_WHITE, gunstring5); SendClientMessage(playerid, COLOR_GREEN,"_______________________________________"); return 1; } strmid(gunid, tmp, 0, strlen(cmdtext), 255); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { format(string, sizeof(string), "{00A1FF}USAGE{FFFFFF}: /buygun [gunname] [ammoamount]"); return 1; } new ammo = strval(tmp); if(ammo < 1 || ammo > 999) { SendClientMessage(playerid, COLOR_GREY, "[Eroare]: Ammo ammount not lower then 1 or higher then 999 !"); return 1; } if (strcmp(gunid, "parachute", true, strlen(gunid)) == 0) { gun = 46; guncharge = GunPrice[0][0]/100*mod2; ammocharge = 0; } else if (strcmp(gunid, "golfclub", true, strlen(gunid)) == 0) { gun = 2; guncharge = GunPrice[1][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 2; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "nightstick", true, strlen(gunid)) == 0) { gun = 3; guncharge = GunPrice[2][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 3; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "baseballbat", true, strlen(gunid)) == 0) { gun = 5; guncharge = GunPrice[4][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 5; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "shovel", true, strlen(gunid)) == 0) { gun = 6; guncharge = GunPrice[5][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 6; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "poolcue", true, strlen(gunid)) == 0) { gun = 7; guncharge = GunPrice[6][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 7; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "purpledildo", true, strlen(gunid)) == 0) { gun = 10; guncharge = GunPrice[7][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 10; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "whitedildo", true, strlen(gunid)) == 0) { gun = 11; guncharge = GunPrice[8][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 11; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "longwhitedildo", true, strlen(gunid)) == 0) { gun = 12; guncharge = GunPrice[9][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 12; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "whitedildo2", true, strlen(gunid)) == 0) { gun = 13; guncharge = GunPrice[10][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 13; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "flowers", true, strlen(gunid)) == 0) { gun = 14; guncharge = GunPrice[11][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 14; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "cane", true, strlen(gunid)) == 0) { gun = 15; guncharge = GunPrice[12][0]/100*mod2; ammocharge = 0; //PlayerInfo[playerid][pGun1] = 15; PlayerInfo[playerid][pAmmo1] = 1; } else if (strcmp(gunid, "sdpistol", true, strlen(gunid)) == 0) { gun = 23; guncharge = GunPrice[13][0]/100*mod2; ammocharge = GunPrice[25][0]*ammo; //PlayerInfo[playerid][pGun2] = 23; PlayerInfo[playerid][pAmmo2] = ammo; } else if (strcmp(gunid, "deagle", true, strlen(gunid)) == 0) { gun = 24; guncharge = GunPrice[15][0]/100*mod2; ammocharge = GunPrice[25][0]*ammo; //PlayerInfo[playerid][pGun2] = 24; PlayerInfo[playerid][pAmmo2] = ammo; } else if (strcmp(gunid, "mp5", true, strlen(gunid)) == 0) { gun = 29; guncharge = GunPrice[18][0]/100*mod2; ammocharge = GunPrice[27][0]*ammo; //PlayerInfo[playerid][pGun3] = 29; PlayerInfo[playerid][pAmmo3] = ammo; } else if (strcmp(gunid, "shotgun", true, strlen(gunid)) == 0) { gun = 25; guncharge = GunPrice[19][0]/100*mod2; ammocharge = GunPrice[26][0]*ammo; //PlayerInfo[playerid][pGun3] = 25; PlayerInfo[playerid][pAmmo3] = ammo; } else if (strcmp(gunid, "ak47", true, strlen(gunid)) == 0) { gun = 30; guncharge = GunPrice[22][0]/100*mod2; ammocharge = GunPrice[28][0]*ammo; //PlayerInfo[playerid][pGun4] = 30; PlayerInfo[playerid][pAmmo4] = ammo; } else if (strcmp(gunid, "m4", true, strlen(gunid)) == 0) { gun = 31; guncharge = GunPrice[23][0]/100*mod2; ammocharge = GunPrice[28][0]*ammo; //PlayerInfo[playerid][pGun4] = 31; PlayerInfo[playerid][pAmmo4] = ammo; } else if (strcmp(gunid, "rifle", true, strlen(gunid)) == 0) { gun = 33; guncharge = GunPrice[24][0]/100*mod2; ammocharge = GunPrice[29][0]*ammo; //PlayerInfo[playerid][pGun4] = 33; PlayerInfo[playerid][pAmmo4] = ammo; } else { SendClientMessage(playerid, COLOR_GRAD6, "ShopKeeper says: I have never heard of that weapon."); return 1; } if((guncharge+ammocharge) > GetPlayerMoney(playerid)) { format(infostring, 256, "[Eroare]: You don't have %s !",DecimalPoint(guncharge+ammocharge)); SendClientMessage(playerid, COLOR_GRAD3, infostring); return 1; } if(GetPlayerMoney(playerid) < (guncharge+ammocharge)) { SendClientMessage(playerid, COLOR_GREY, "[Eroare]: Can't afford that !"); return 1; } new payout = guncharge + ammocharge; format(infostring, 256, "You have purchased %s with %d ammo for %s",gunid,ammo,DecimalPoint(payout)); SendClientMessage(playerid, COLOR_GRAD3, infostring); if(location == 203 && IsACop(playerid)) { } else { SafeGivePlayerMoney(playerid, - payout); } BizzInfo[location-200][bTill] += payout; ExtortionBiz(location-200, payout); BizzInfo[location-200][bProducts]--; PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); SafeGivePlayerWeapon(playerid, gun, ammo); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "%s bought weapons for %s at biz %d", sendername, DecimalPoint(payout), location-200); PayLog(string); } else { SendClientMessage(playerid, COLOR_WHITE,"[Eroare]: You are not in a store."); return 1; } } return 1; }
-
http://wiki.sa-mp.com/wiki/TogglePlayerSpectating
-
Nu ai comanda /spec?
