[Pomoc] Tajne Komande

Započeo Swet, April 14, 2013, 20:28:00 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:Moj
Detaljan opis problema:Kako da napravim komandu da daje admina i to
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):/
Srednji=Skripter ;)

Ovo je stari sistem nije zcmd ali radi posao zavisi koji GM koristis
if(strcmp(cmd, "/setadminlevel", true) == 0 || strcmp(cmd, "/sal", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /[s]et[a]dmin[l]evel [playerid/PartOfName] [level(1-1338)]");
				return 1;
			}
			new para1;
			new level;
			new playerlevel;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			playerlevel = PlayerInfo[para1][pAdmin];
			if(PlayerInfo[playerid][pAdmin] >= 1336 || IsPlayerAdmin(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 <= 1335) return SendClientMessage(playerid, COLOR_GREY,"* Only levels 0-6 and 1336-1337-1338 Are allowed!");
						if(level < 0 || level > 1338) return SendClientMessage(playerid, COLOR_GREY,"* Only levels 0-6 and 1336-1337-1338 Are allowed!");
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						new Float:X, Float:Y, Float:Z;
						GetPlayerPos(para1, X,Y,Z);
						format(string, sizeof(string),"[ADMIN]: %s has set %s (%d)'s Level to: [%d]", sendername, giveplayer, para1, level);
						ABroadCast(COLOR_LIGHTRED, string, 5);
						format(string, sizeof(string), "** %s Gave You Admin Level: %d",sendername, level);
						SendClientMessage(para1, TEAM_GROVE_COLOR, string);
						if(level > PlayerInfo[para1][pAdmin])
						{
							format(string, sizeof(string), "Congratulations to %s. He is now Level: %d Admin !!!!",giveplayer, level);
							SendClientMessageToAll(COLOR_LIGHTBLUE, string);
                            PlayerPlaySound(para1, 1056, X, Y, Z);
                            GameTextForPlayer(para1, "~y~Promoted!",7500,3);
                            format(string, sizeof(string), "** You have promoted %s (%d) to level %d.", giveplayer, para1, level);
							SendClientMessage(playerid, COLOR_LIGHTRED, string);
							PlayerInfo[para1][pAdmin] = level;
							PlayerInfo[para1][pHelper] = 3;
							if(playerlevel == 0 && level >= 1)
							{
							    admins ++;
							}
						}
						else
						{
                            PlayerPlaySound(para1, 1055, X, Y, Z);
                            GameTextForPlayer(para1, "~r~Demoted!",7500,3);
                            format(string, sizeof(string), "** You have demoted %s (%d) to admin level %d.", giveplayer, para1, level);
							SendClientMessage(playerid, COLOR_LIGHTRED, string);
							PlayerInfo[para1][pAdmin] = level;
       						if(level == 0)
							{
								PlayerInfo[para1][pHelper] = 1;
								admins --;
							}
						}
						new y, m, d;
						new h,mi,s;
						getdate(y,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Gave to %s Admin Level: [%d].",d,m,y,h,mi,s,sendername,giveplayer,level);
						AdminLog(string);
						ChatLog(string);
						LoginLog(string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
				return 1;
			}
		}
		return 1;
	}

Ali bi trebao da napravis ceo admin sistem ovo je samo komanda koja postavlja level i mogucnosti u sistemu koji se nalazi u Ravens GM


forum.sa-mp.com info:
Over 1000 posts.
Over 50 reputation.