Grig22
Membru-
Posts
46 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
News
Documentation
Everything posted by Grig22
-
Folositor si bun!Bravo Gireada
-
Pune asta la sfarsitul GM/FS-ului: strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; }
-
Poate nu e exact ceea ce iti doresti tu...dar seamana /* _____________________________________________________________________________ | | | | | | | $$$$$$ $$$$$$ $$$$$$ $$$$$$ | | $ $ $ $ $ $ $ | | $$$$$$ $ $$ $$$$$$ $$$$$$ | | $ $ $ $ $ $ $ | | $ $ $$$$$$ $ $ $ | | | | New DJ Job, suitable for everyone | | Scratch made by SandieL, feel free to use it | | Credits free, don't be afraid to Rep+ ;D Enjoy! | | | |_____________________________________________________________________________| */ #include <a_samp> #include <sscanf2> #include <ZCMD> #define FILTERSCRIPT #define DIALOG_PARTY 1 #define DIALOG_MUSICNAME 2 #define DIALOG_MUSICURL 3 #define P_VEH 459 // Change 459 to whatever vehicle you want as the DJ Van #define MinimumParticipants 5 // Change 5 to whatever minimum number of people you want #if defined FILTERSCRIPT #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_GREY 0xAFAFAFAA new bool:IsADJ[MAX_PLAYERS] = false; // Is the player a DJ? new bool:PartyStarted = false; // Is there a party going on already? new bool:PartyPrepared = false; new bool:Joined[MAX_PLAYERS] = false; new Float:PartyX; new Float:PartyY; new Float:PartyZ; new Admin[MAX_PLAYERS]; // This will be the admin variable in the system, you can change it if you want to. new CurrentParticipants; // Current participants in the party! new PartyVehicle; new SongName[128]; public OnFilterScriptInit() { print("\n--------------------------------------"); print(" DJ Job scratch made by SandieL"); print("--------------------------------------\n"); CurrentParticipants = 0; PartyStarted = false; PartyPrepared = false; return 1; } public OnFilterScriptExit() { return 1; } #else main() {} #endif forward DJTimer(playerid); public DJTimer(playerid) { if(IsADJ[playerid] == true) { new string[128]; IsADJ[playerid] = false; PartyStarted = false; PartyPrepared = false; CurrentParticipants = 0; format(string, sizeof(string), "** %s has been removed from being a DJ because the time has passed!", N(playerid)); SendClientMessageToAll(COLOR_LIGHTBLUE, string); } return 1; } public OnPlayerConnect(playerid) { // MAKE SURE YOU CHECK IF THE PLAYER IS A DJ, IF SO, CHECK IF ANYONE ELSE IS A DJ ONLINE AND REMOVE ONE OF THEM // I don't have a save system in this filterscript, so it doesn't really matter if I do it. return 1; } public OnPlayerDisconnect(playerid, reason) { Joined[playerid] = false; CurrentParticipants--; // Don't forget to remove his DJ privliges if he is a DJ! (IsADJ[playerid] = false) return 1; } CMD:assigndj(playerid, params[]) { new ID, time; if(!sscanf(params, "ui", ID, time)) // parameters { if(Admin[playerid] == 3) // Is the player that executed the command an administrator { if(ID != INVALID_PLAYER_ID) { if(time < 6 || time > 0) { // Uncomment the line below to not be able to set yourself as DJ (has to be another person) //if(playerid == id) return SendClientMessage(playerid, COLOR_GREY, ".:: You cannot make yourself a DJ! ::."); for(new i = 0; i < MAX_PLAYERS; i++) if(IsADJ[i] == false) // Is there any DJ online at the moment? (also checks if the ID inserted is a DJ aswell) { new string[128]; IsADJ[ID] = true; format(string, sizeof(string), "%s has made %s a DeeJay in the server!", N(playerid), N(ID)); SendClientMessageToAll(COLOR_LIGHTBLUE, string); SetTimer("DJTimer", 3600000, 0); } else return SendClientMessage(playerid, COLOR_GREY, ".:: There already is a DJ online ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: The DJ hours can't exceed 5 hours ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: The player id you entered does not exist ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not allowed to use this command ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: USAGE: /assigndj [Playerid/PartOfName] [Hours] ::."); return 1; } CMD:prepareparty(playerid, params[]) { if(IsADJ[playerid] == true) // Is he a DJ? { if(PartyStarted == false && PartyPrepared == false) // Is there a party going on? { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == P_VEH) // DJ Van { PartyVehicle = GetPlayerVehicleID(playerid); PartyPrepared = true; CurrentParticipants = 0; SendClientMessage(playerid, COLOR_LIGHTBLUE, "** The party is prepared, use /startparty to start it once there are 5 people!"); GetPlayerPos(playerid, Float:PartyX, Float:PartyY, Float:PartyZ); for(new i = 0; i < MAX_PLAYERS; i++) if(playerid != i) { ShowPlayerDialog(playerid, DIALOG_PARTY, DIALOG_STYLE_MSGBOX, "There is a party going on...", "There is a party going on, it just started, do you wish to join?", "Okay", "Cancel"); } } else return SendClientMessage(playerid, COLOR_GREY, ".:: You need to be inside the DJ Van to use this feature ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: There already is a party underway (Or a party is already prepared, use /startparty) ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not allowed to use this command ::."); return 1; } CMD:startparty(playerid, params[]) { if(IsADJ[playerid] == true) // Is he a DJ? { if(PartyStarted == false) // Is there a party going on? { if(PartyPrepared == true) // Is the party prepared? { if(CurrentParticipants >= MinimumParticipants-1) // If there are the correct number of people to start this shit { PartyStarted = true; PartyPrepared = false; SendClientMessageToAll(COLOR_LIGHTBLUE, "** 5 people have joined the party, and it is underway, get there fast!"); } else return SendClientMessage(playerid, COLOR_GREY, ".:: You must wait for atleast 5 people to join first! ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: There is no party prepared, use /prepareparty to prepare one! ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: There already is a party underway (Or a party is already prepared, use /startparty) ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not allowed to use this command ::."); return 1; } CMD:play(playerid, params[]) { if(IsADJ[playerid] == true) { if(PartyStarted == true) { if(IsPlayerInFrontVehicle(playerid,PartyVehicle,3,-4) == 1) { ShowPlayerDialog(playerid, DIALOG_MUSICNAME, DIALOG_STYLE_INPUT, "What is this songs name?", "What is the name of this song you are going to play?", "Okay", "Cancel"); } else return SendClientMessage(playerid, COLOR_GREY, ".:: You need to be behind the Party Van to use this feature ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: There is no party being held at the moment ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not allowed to use this command ::."); return 1; } CMD:endparty(playerid, params[]) { if(IsADJ[playerid] == true) { if(PartyStarted == true || PartyPrepared == true) { new string[128]; PartyStarted = false; PartyPrepared = false; CurrentParticipants = 0; format(string, sizeof(string), "** DeeJay %s has ended the party! Untill next time. **", N(playerid)); } else return SendClientMessage(playerid, COLOR_GREY, ".:: There is no party being held at the moment ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not allowed to use this command ::."); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch( dialogid ) { case DIALOG_PARTY: { if(response) { if(PartyPrepared == true || PartyStarted == true) { if(Joined[playerid] == false) { SetPlayerCheckpoint(playerid, Float:PartyX, Float:PartyY, Float:PartyZ, 3); SendClientMessage(playerid, COLOR_GREY, " (( Get to the checkpoint to join the party before it's over!"); } else return SendClientMessage(playerid, COLOR_GREY, ".:: You already joined this party! ::."); } else return SendClientMessage(playerid, COLOR_GREY, ".:: There are no current parties being held at the moment ::."); } } case DIALOG_MUSICNAME: { if(response) { if(PartyPrepared == true || PartyStarted == true) { format(SongName, sizeof(SongName), "%s", inputtext); ShowPlayerDialog(playerid, DIALOG_MUSICURL, DIALOG_STYLE_INPUT, "What is the URL of this song?", "Insert below the URL of the song you want to play (MUST BE MP3 LINK", "Okay", "Cancel"); } else return SendClientMessage(playerid, COLOR_GREY, ".:: There is no party being held at the moment ::."); } } case DIALOG_MUSICURL: { if(response) { if(PartyPrepared == true || PartyStarted == true) { new string[128]; format(string, sizeof(string), "** %s has played the song '%s' **", N(playerid), SongName); for(new i = 0; i < MAX_PLAYERS; i++) if(Joined[i] == true || IsADJ[i] == true) { PlayAudioStreamForPlayer(i, inputtext, 0, 0, 0, 50, 0); } } else return SendClientMessage(playerid, COLOR_GREY, ".:: There is no party being held at the moment ::."); } } } return 0; } public OnPlayerEnterCheckpoint(playerid) { if(IsADJ[playerid] == false) { new string[128]; Joined[playerid] = true; CurrentParticipants++; for(new i = 0; i < MAX_PLAYERS; i++) if(Joined[i] == true) { format(string, sizeof(string), "** %s has joined the party! there are now %d participants!", N(playerid), CurrentParticipants); SendClientMessage(i, COLOR_LIGHTBLUE, string); } } return 1; } // ====================================================================================================== // NAME RELATED STOCKS, IGNORE IGNORE IGNORE IGNORE stock GetPlayerFirstName(playerid) { new NickName[MAX_PLAYER_NAME]; GetPlayerName(playerid, NickName, MAX_PLAYER_NAME); strdel(NickName, strfind(NickName, "_"), strlen(NickName)); return NickName; } stock GetPlayerLastName(playerid) { new namestring[2][MAX_PLAYER_NAME]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); split(name, namestring, '_'); return namestring[1]; } stock N(playerid) { new NA[32]; format(NA, sizeof(NA), "%s %s", GetPlayerFirstName(playerid), GetPlayerLastName(playerid)); return NA; } stock split(const strsrc[], strdest[][], delimiter) { new i, li; new aNum; new len; while(i <= strlen(strsrc)){ if(strsrc[i]==delimiter || i==strlen(strsrc)){ len = strmid(strdest[aNum], strsrc, li, i, 128); strdest[aNum][len] = 0; li = i+1; aNum++; } i++; } return 1; } stock IsPlayerInFrontVehicle(playerid,vehicleid,Float:radius,Float:vehiclelength) { new Float:x,Float:y,Float:z,Float:a; GetVehiclePos(vehicleid, x, y, z); GetPlayerFacingAngle(vehicleid, a); x += (vehiclelength* floatsin(-a, degrees)); y += (vehiclelength* floatcos(-a, degrees)); return IsPlayerInRangeOfPoint(playerid,radius,x,y,z); }
-
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "%s has joined the server", pname); SendClientMessageToAll(0xAAAAAAAA, string); return 1; } Asta pui sub public OnPlayerConnect Iar asta : new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); switch(reason) { case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname); case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname); case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname); } SendClientMessageToAll(0xAAAAAAAA, string); return 1; } sub public OnplayerDisconnect
-
Cum adaug comanda de schimare nume server?
Grig22 replied to mihai1122's question in Arhivă probleme
Poti incerca /rcon hostname RPG X Va asteapta cu mult drag ! -
Poftim : public OnPlayerConnect(playerid) { new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "%s has joined the server", pname); SendClientMessageToAll(0xAAAAAAAA, string); return 1; } Si : public OnPlayerDisconnect(playerid, reason) { new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); switch(reason) { case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname); case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname); case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname); } SendClientMessageToAll(0xAAAAAAAA, string); return 1; }
-
Gura mica copile ca nu sti pic de scripting si te dai mare cu sv-u tau RRS v5 edit. ON: Rimmon ce sa zic 5/5 pt acest sv
-
Asta nu e eroare :-j . Se numeste warning Incearca sa duci return 1; putin mai la stanga...adik sa ii dai un BackSpace Sau daca nu incearca asa : //-------------------------------------------------- if(strcmp(cmd, "/aod", true) == 0) { if (PlayerInfo[playerid][pAdmin] >= 1) { if(AdminDuty[playerid] == 0) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); format(string,sizeof(string),"Admin %s is now on Duty.",name,playerid); SendClientMessageToAll(0x8E4D31FF,string); AdminDuty[playerid] = 1; new setname[16]; format(setname, sizeof(setname), "%s[AOD]",name); if(!strlen(name[11])) { aodtag[playerid] = 1; SetPlayerName(playerid,setname); } SetPlayerHealth(playerid,999); SetPlayerArmour(playerid,31000000000); } else { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); format(string,sizeof(string),"Admin %s is no longer on Duty.",name,playerid); SendClientMessageToAll(0x756FEEFF,string); AdminDuty[playerid] = 0; new pname[16]; GetPlayerName(playerid,pname,16); strdel(pname, strlen(pname)-5, strlen(pname)); if(aodtag[playerid] == 1) { aodtag[playerid] = 0; SetPlayerName(playerid,pname); } SetPlayerHealth(playerid,100); SetPlayerArmour(playerid,000); } } return 1; }
-
Eu spun ca mai bn ar fii sa le pui in GM,deoarece tot script-ul din GM v-a fii citit primul,apoi pe urma FS-urile
-
Incearca sa ne dai si sursa,adica liniile cu warning-uri...din FS-ul respectiv.
-
S-ar putea sa fie si de la firewall,se mai intampla mai ales la sa-mp.Incearca sa dezactivezi/activezi Windows Firewall :D
-
Poftim tutorial Run Time Error 19: http://www.sa-mp.ro/forum/index.php?topic=24930.0
-
Wow, ft bn 10/10,pentru primul tau FS )
-
Omule ce nu am voie sa imi dau si eu cu parerea? Mi-am spus si eu parerea ce nu am voie sau ce?
-
Dialogul are un id care mai este folosit.Dar daca ai Fs pune-l prium la lina Filterscripts::D
-
Warinig-urile aste ti le da,deoarece functiile respective nu sunt puse unde trebuie.Pot fi mutate in dreapta,stanga si de aia iti da warning.
-
Poi numele Stunt Life Gaming ft frumos;)
-
Ft bun bv 5/5.Si apropo frumos sunt Stunt Life Gaming;)
-
Descarci cum a spus Diabolik. Dupa il pui in X\Serverul tau\PAWNO\INCLUDES.
-
Gireada mereu a venit cu FS,GM-uri noi.Sper sa o Tii tot ASA (P.S.)Sunt nou pe SAMP.RO