Jump to content
  • 0

Cautare script


Nobru

Question

15 answers to this question

Recommended Posts

nu la asta m-am referit :D e o comanda pentru admini level 3+ de exemplu , iar la eventuri au comanda /event healall de exemplu , si toti care sunt in zona de langa admin primesc heal , sau /event heal hp , la fel toti din raza primesc hp , /event giveweapon id gloante si le da la toti din zona arma :) apare si un text in chat de genul : "Admin x has gived you a weapon with xxx bullets" , depinde de comanda :D sper ca ai prins ce caut

Link to comment
Share on other sites

cauta ma si u in alt Gm k nimeni nu iti da mura in gura

comenzile astea le gasesti in majoritatea sv

    if(strcmp(cmd, "/healall", true) == 0)
	{
	    GetPlayerName(playerid, sendername, sizeof(sendername));

	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pAdmin] >= 3)
	        {
	        	format(string, sizeof(string), "Adminul %s a dat viata tuturor playerilor de pe server.", sendername);
	    		SendClientMessageToAll(0xFF7171FF, string);
	            for(new i = 0; i < MAX_PLAYERS; i ++)
				{
				    if(IsPlayerConnected(i))
				    {
					    SetPlayerHealth(i, 200);
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "NU aveti acces la aceasta comanda !");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "Trebuie sa fiti logat pentru a folosi aceasta comanda!");
		}
		return 1;
	}
	if(strcmp(cmd, "/gethere", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /gethere [playerid/PartOfName]");
				return 1;
			}
			new Float:plocx,Float:plocy,Float:plocz;
			new plo;
			plo = ReturnUser(tmp);
			if (IsPlayerConnected(plo))
			{
			    if(plo != INVALID_PLAYER_ID)
			    {
					if (PlayerInfo[plo][pAdmin] > 3)
					{
						SendClientMessage(playerid, COLOR_GRAD1, " Ask the admin to goto you.");
						return 1;
					}
					if (PlayerInfo[playerid][pAdmin] >= 3)
					{
						GetPlayerPos(playerid, plocx, plocy, plocz);
						if(PlayerInfo[playerid][pInt] > 0)
						{
							SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
							PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];
							PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
						}
						if(PlayerInfo[playerid][pInt] == 0)
						{
							SetPlayerInterior(plo,0);
						}
						if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0) //the highest land point in sa = 526.8
						{
							SetPlayerInterior(plo,1);
							PlayerInfo[plo][pInt] = 1;
						}
						if (GetPlayerState(plo) == 2)
						{
							TelePos[plo][0] = 0.0;
							TelePos[plo][1] = 0.0;
							new tmpcar = GetPlayerVehicleID(plo);
							SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
						}
						else
						{
							SetPlayerPos(plo,plocx,plocy+2, plocz);
						}
						SendClientMessage(plo, COLOR_GRAD1, " You have been teleported");
					}
					else
					{
						SendClientMessage(playerid, 0xFF3300FF, " NU ai autorizatie pentru a folosi aceasta comanda !");
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_WHITE, " That player is Offline !");
				return 1;
			}
		}
		return 1;
	}
	if(strcmp(cmd, "/sethp", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /sethp [playerid/PartOfName] [health]");
				return 1;
			}
			new playa;
			new health;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			health = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
 						GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						SetPlayerHealth(playa, health);
						format(string, 256, "AdmWarning: %s has set %s's hp to %d.", sendername,giveplayer,health);
						ABroadCast(COLOR_YELLOW,string,1);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, 0xFF3300FF, " NU ai autorizatie pentru a folosi aceasta comanda !");
			}
		}
		return 1;
	}
	if(strcmp(cmd, "/givegun", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givegun [playerid/PartOfName] [weaponid(eg. 46 = Parachute)] [ammo]");
				return 1;
			}
			new playa;
			new gun;
			new ammo;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			gun = strval(tmp);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /givegun [playerid/PartOfName] [weaponid] [ammo]");
				SendClientMessage(playerid, COLOR_GRAD4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
				SendClientMessage(playerid, COLOR_GRAD3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 38(Minigun) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
				return 1;
			}
			new giver[MAX_PLAYER_NAME];
			new taker[MAX_PLAYER_NAME];
			GetPlayerName(playerid, giver, sizeof(giver));
			GetPlayerName(playa, taker, sizeof(taker));
			if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==36||gun==38||gun==39||gun==40||gun==44||gun==45)
			{ SendClientMessage(playerid, COLOR_GRAD1, " wrong WeaponID!"); return 1; }
			tmp = strtok(cmdtext, idx);
			ammo = strval(tmp);
			if(ammo <1||ammo > 999)
			{ SendClientMessage(playerid, COLOR_GRAD1, " dont go below 1 or above 999 bullets!"); return 1; }
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						format(string, sizeof(string), "* You have been a gun %d with %d ammo by admin %s.", gun, ammo, giver);
						SendClientMessage(playa, COLOR_LIGHTRED, string);
						format(string, sizeof(string), "* You have give gun %d with %d ammo to %s.", gun, ammo, taker);
						SendClientMessage(playerid, COLOR_LIGHTRED, string);
			            format(string, sizeof(string), "AdmWarning: %s has given %s a weapon number %d with %d ammo.", giver, taker, gun, ammo);
			            ABroadCast(COLOR_YELLOW,string,1);
						GivePlayerWeapon(playa, gun, ammo);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, 0xFF3300FF, " NU ai autorizatie pentru a folosi aceasta comanda !");
			}
		}
		return 1;
	}

astea sunt comenzile sper k data viitoare sa cauti si u putin

Link to comment
Share on other sites

n`ai prins ideea :) am comenzile astea , dar e una care le contine pe toate ca si pe linkmania , cum e asta de aici , dar asta da eroare la compilare : http://forum.sa-mp.com/showthread.php?t=152760&highlight=%2Fevent+healall

Acum ati inteles la ce ma refer ? nu le vreau pe toate separat....

Link to comment
Share on other sites

Nobrule ceva in genu astia ia vezi :

//------------------------------- [bY Jo!nTâ„¢] -----------------------------------------

    if(strcmp(cmd, "/eventheal", true) == 0)

{

    GetPlayerName(playerid, sendername, sizeof(sendername));

new victim = GetClosestPlayer(playerid);

    if(IsPlayerConnected(playerid))

        if(GetDistanceBetweenPlayers(playerid,victim) < 100)

  {

        if(PlayerInfo[playerid][pAdmin] >= 4)

        {

        format(string, sizeof(string), "[EVENT] Administrator %s has healed all players to 50m", sendername);

    SendClientMessageToAll(0xFF7171FF, string);

            for(new i = 0; i < MAX_PLAYERS; i ++)

{

    if(IsPlayerConnected(i))

    {

    SetPlayerHealth(i, 100);

}

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "There is not players near you .");

}

return 1;

}

16189165.gifrastamaunbydeejaylobo1.gifsmileysw0181.gif

xmsok6ay41.gif

Link to comment
Share on other sites

Da cam asa ceva :) Uite am gasit cam ce vreau , dar da eroare la compilare , nu stiu de ce :|

if(strcmp(cmd, "/event", true) == 0)
    {
        for(new i=0; i<MAX_PLAYERS; i++)
    {
 if(IsPlayerConnected(playerid))
      {
        if(PlayerInfo[playerid][pAdmin] >= 4)
        {
              new x_nr[256];
                x_nr = strtok(cmdtext, idx);
                if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /event [heal,healall,gethere,giveweapon]");
                return 1;
                }
            if(strcmp(x_nr,"heal",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
                        if (ProxDetectorS(5.0, playerid, i))
                        {
                          if(IsPlayerConnected(i))
                          {
                              new amount;
                            tmp = strtok(cmdtext, idx);
                                amount = strval(tmp);
                                if(!strlen(tmp))
                                {
                                    SendClientMessage(playerid,COLOR_SYSTEM,"USAGE: /event heal [hp]");
                                    return 1;
                                }
                                GetPlayerName(playerid, sendername, sizeof(sendername));
                              SetPlayerHealth(i, amount);
                                format(string, sizeof(string), "[EVENT]: %s has setted everyones near him health at %d.",sendername,amount);
                                SendClientMessageToAll(COLOR_LIGHTRED, string);
                                return 1;
                            }
                        }
                    }
                }
             }
                if(strcmp(x_nr,"healall",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
                      if(IsPlayerConnected(i))
                      {
                        new amount;
                            tmp = strtok(cmdtext, idx);
                            amount = strval(tmp);
                            if(!strlen(tmp))
                            {
                                SendClientMessage(playerid,COLOR_SYSTEM,"USAGE: /event healall [hp]");
                                return 1;
                            }
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                        SetPlayerHealth(i, amount);
                            format(string, sizeof(string), "[EVENT]: %s has setted everyones health at %d.",sendername,amount);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
                if(strcmp(x_nr,"gethere",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
            if(IsPlayerConnected(i))
                    {
                          new Float:X, Float:Y, Float:Z;
                          GetPlayerPos(playerid, X,Y,Z);
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            if(GetPlayerState(i) == 2)
                            {
                            SetPlayerPos(i, X,Y+4,Z);
                            }
                            else
                            {
                              SetPlayerPos(i, X,Y+2,Z);
                            }
                            format(string, sizeof(string), "[EVENT]: %s had telported %d players at him.",sendername,PlayersOnline);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
                if(strcmp(x_nr,"givegun",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
                      if(IsPlayerConnected(i))
                      {
                          new gun,ammo;
                            tmp = strtok(cmdtext, idx);
                            gun = strval(tmp);
                            if(!strlen(tmp))
                            {
                                SendClientMessage(playerid, COLOR_GREY, "USAGE: /event givegun [gunid] [ammo]");
                                SendClientMessage(playerid, COLOR_GRAD1, "Melee I: Golf Club (2) | Nitestick (3) | Knife (4) | Baseball Bat (5)");
                                SendClientMessage(playerid, COLOR_GRAD1, "Melee I: Shovel (6) | Pool Cue (7) | Katana (8) | Chainsaw (9)");
                                SendClientMessage(playerid, COLOR_GRAD2, "Melee II: Purple Dildo (10) | Small White Vibrator (11) | Large White Vibrator (12)");
                  SendClientMessage(playerid, COLOR_GRAD2, "Melee II: Silver Vibrator (13) | Flowers (14) | Cane (15)");
                                SendClientMessage(playerid, COLOR_GRAD3, "Pistol: 9MM (22) | Sillenced 9MM (23) | Deagle (24)");
                                SendClientMessage(playerid, COLOR_GRAD4, "Shotgun: Shotgun (25)");
                                SendClientMessage(playerid, COLOR_GRAD5, "SMG: MP5 (29)");
                                SendClientMessage(playerid, COLOR_GRAD6, "Assault: AK-47 (30) | M4 (31)");
                                SendClientMessage(playerid, COLOR_WHITE, "Rifle: Country Rifle (33) | Sniper Rifle (34)");
                                return 1;
                            }
                            if(gun == 1 || gun >= 16 && gun <= 21 || gun == 26 || gun == 27 || gun == 28 || gun == 32 || gun >= 35 && gun <= 46)
                            {
                                SendClientMessage(playerid, COLOR_WHITE, "The WeaponID is wrong !");
                                return 1;
                            }
                            tmp = strtok(cmdtext, idx);
                            ammo = strval(tmp);
                            if(ammo <1 ||ammo > 999)
                            { SendClientMessage(playerid, COLOR_GRAD1, "dont go below 1 or above 999 bullets!"); return 1; }
                        new ftext[50];
                            if(gun == 1) { ftext = "Brass Knuckles"; }
                            else if(gun == 2) { ftext = "Golf Club"; }
                            else if(gun == 3) { ftext = "NightStick"; }
                            else if(gun == 4) { ftext = "Knife"; }
                            else if(gun == 5) { ftext = "Baseball Bat"; }
                            else if(gun == 6) { ftext = "Shovel"; }
                            else if(gun == 7) { ftext = "Pool Cue"; }
                            else if(gun == 8) { ftext = "Katana"; }
                            else if(gun == 9) { ftext = "Chainsaw"; }
                            else if(gun == 10) { ftext = "Purple Dildo"; }
                            else if(gun == 11) { ftext = "Small White Vibrator"; }
                            else if(gun == 12) { ftext = "Large White Vibrator"; }
                            else if(gun == 13) { ftext = "Silver Vibrator"; }
                            else if(gun == 14) { ftext = "Flowers"; }
                            else if(gun == 15) { ftext = "Cane"; }
                            else if(gun == 16) { ftext = "Grenade"; }
                            else if(gun == 17) { ftext = "Tear Gas"; }
                            else if(gun == 18) { ftext = "Molotov Cocktail"; }
                            else if(gun == 22) { ftext = "9MM"; }
                            else if(gun == 23) { ftext = "Silenced 9mm"; }
                            else if(gun == 24) { ftext = "Desert Eagle"; }
                            else if(gun == 25) { ftext = "Shotgun"; }
                            else if(gun == 26) { ftext = "Sawn-off Shotgun"; }
                            else if(gun == 27) { ftext = "Combat Shotgun"; }
                            else if(gun == 28) { ftext = "Micro SMG"; }
                            else if(gun == 29) { ftext = "MP5"; }
                            else if(gun == 30) { ftext = "AK-47"; }
                            else if(gun == 31) { ftext = "M4"; }
                            else if(gun == 32) { ftext = "Tec9"; }
                            else if(gun == 33) { ftext = "Country Rifle"; }
                            else if(gun == 34) { ftext = "Sniper Rifle"; }
                            else if(gun == 35) { ftext = "Rocket Launcher"; }
                            else if(gun == 36) { ftext = "HS Rocket Launcher"; }
                            else if(gun == 37) { ftext = "Flamethrower"; }
                            else if(gun == 38) { ftext = "Minigun"; }
                            else if(gun == 41) { ftext = "Spraycan"; }
                            else if(gun == 42) { ftext = "Fire Extinguisher"; }
                            else if(gun == 43) { ftext = "Camera"; }
                            else if(gun == 44) { ftext = "Nightvision Goggle"; }
                            else if(gun == 45) { ftext = "Thermal Goggles"; }
                            else if(gun == 46) { ftext = "Parachutte"; }
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            GivePlayerWeapon(i, gun, ammo);
                            format(string, sizeof(string), "[EVENT]: %s has given a %s with %d ammo.",sendername,ftext,ammo);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
            }
        }
        return 1;
    }

Poate reuseste careva sa il compileze pt 0.3b ?

Link to comment
Share on other sites

C:\Documents and Settings\x\Desktop\asdfgh.pwn(1) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(3) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(5) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(7) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(10) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(11) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(14) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(16) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(18) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(20) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(22) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(25) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(27) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(30) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(32) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(32) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(32 -- 34) : error 010: invalid function or declaration

C:\Documents and Settings\x\Desktop\asdfgh.pwn(32 -- 34) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

18 Errors.

Link to comment
Share on other sites

Daca nu sti script lasate frate:

public OnPlayerCommandText(playerid, cmdtext[])//Thx to Samy
{
if(strcmp(cmd, "/event", true) == 0)
    {
        for(new i=0; i<MAX_PLAYERS; i++)
    {
 if(IsPlayerConnected(playerid))
      {
        if(PlayerInfo[playerid][pAdmin] >= 4)
        {
              new x_nr[256];
                x_nr = strtok(cmdtext, idx);
                if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /event [heal,healall,gethere,giveweapon]");
                return 1;
                }
            if(strcmp(x_nr,"heal",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
                        if (ProxDetectorS(5.0, playerid, i))
                        {
                          if(IsPlayerConnected(i))
                          {
                              new amount;
                            tmp = strtok(cmdtext, idx);
                                amount = strval(tmp);
                                if(!strlen(tmp))
                                {
                                    SendClientMessage(playerid,COLOR_SYSTEM,"USAGE: /event heal [hp]");
                                    return 1;
                                }
                                GetPlayerName(playerid, sendername, sizeof(sendername));
                              SetPlayerHealth(i, amount);
                                format(string, sizeof(string), "[EVENT]: %s has setted everyones near him health at %d.",sendername,amount);
                                SendClientMessageToAll(COLOR_LIGHTRED, string);
                                return 1;
                            }
                        }
                    }
                }
             }
                if(strcmp(x_nr,"healall",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
                      if(IsPlayerConnected(i))
                      {
                        new amount;
                            tmp = strtok(cmdtext, idx);
                            amount = strval(tmp);
                            if(!strlen(tmp))
                            {
                                SendClientMessage(playerid,COLOR_SYSTEM,"USAGE: /event healall [hp]");
                                return 1;
                            }
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                        SetPlayerHealth(i, amount);
                            format(string, sizeof(string), "[EVENT]: %s has setted everyones health at %d.",sendername,amount);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
                if(strcmp(x_nr,"gethere",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
            if(IsPlayerConnected(i))
                    {
                          new Float:X, Float:Y, Float:Z;
                          GetPlayerPos(playerid, X,Y,Z);
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            if(GetPlayerState(i) == 2)
                            {
                            SetPlayerPos(i, X,Y+4,Z);
                            }
                            else
                            {
                              SetPlayerPos(i, X,Y+2,Z);
                            }
                            format(string, sizeof(string), "[EVENT]: %s had telported %d players at him.",sendername,PlayersOnline);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
                if(strcmp(x_nr,"givegun",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
                      if(IsPlayerConnected(i))
                      {
                          new gun,ammo;
                            tmp = strtok(cmdtext, idx);
                            gun = strval(tmp);
                            if(!strlen(tmp))
                            {
                                SendClientMessage(playerid, COLOR_GREY, "USAGE: /event givegun [gunid] [ammo]");
                                SendClientMessage(playerid, COLOR_GRAD1, "Melee I: Golf Club (2) | Nitestick (3) | Knife (4) | Baseball Bat (5)");
                                SendClientMessage(playerid, COLOR_GRAD1, "Melee I: Shovel (6) | Pool Cue (7) | Katana (8) | Chainsaw (9)");
                                SendClientMessage(playerid, COLOR_GRAD2, "Melee II: Purple Dildo (10) | Small White Vibrator (11) | Large White Vibrator (12)");
                  SendClientMessage(playerid, COLOR_GRAD2, "Melee II: Silver Vibrator (13) | Flowers (14) | Cane (15)");
                                SendClientMessage(playerid, COLOR_GRAD3, "Pistol: 9MM (22) | Sillenced 9MM (23) | Deagle (24)");
                                SendClientMessage(playerid, COLOR_GRAD4, "Shotgun: Shotgun (25)");
                                SendClientMessage(playerid, COLOR_GRAD5, "SMG: MP5 (29)");
                                SendClientMessage(playerid, COLOR_GRAD6, "Assault: AK-47 (30) | M4 (31)");
                                SendClientMessage(playerid, COLOR_WHITE, "Rifle: Country Rifle (33) | Sniper Rifle (34)");
                                return 1;
                            }
                            if(gun == 1 || gun >= 16 && gun <= 21 || gun == 26 || gun == 27 || gun == 28 || gun == 32 || gun >= 35 && gun <= 46)
                            {
                                SendClientMessage(playerid, COLOR_WHITE, "The WeaponID is wrong !");
                                return 1;
                            }
                            tmp = strtok(cmdtext, idx);
                            ammo = strval(tmp);
                            if(ammo <1 ||ammo > 999)
                            { SendClientMessage(playerid, COLOR_GRAD1, "dont go below 1 or above 999 bullets!"); return 1; }
                        new ftext[50];
                            if(gun == 1) { ftext = "Brass Knuckles"; }
                            else if(gun == 2) { ftext = "Golf Club"; }
                            else if(gun == 3) { ftext = "NightStick"; }
                            else if(gun == 4) { ftext = "Knife"; }
                            else if(gun == 5) { ftext = "Baseball Bat"; }
                            else if(gun == 6) { ftext = "Shovel"; }
                            else if(gun == 7) { ftext = "Pool Cue"; }
                            else if(gun == 8) { ftext = "Katana"; }
                            else if(gun == 9) { ftext = "Chainsaw"; }
                            else if(gun == 10) { ftext = "Purple Dildo"; }
                            else if(gun == 11) { ftext = "Small White Vibrator"; }
                            else if(gun == 12) { ftext = "Large White Vibrator"; }
                            else if(gun == 13) { ftext = "Silver Vibrator"; }
                            else if(gun == 14) { ftext = "Flowers"; }
                            else if(gun == 15) { ftext = "Cane"; }
                            else if(gun == 16) { ftext = "Grenade"; }
                            else if(gun == 17) { ftext = "Tear Gas"; }
                            else if(gun == 18) { ftext = "Molotov Cocktail"; }
                            else if(gun == 22) { ftext = "9MM"; }
                            else if(gun == 23) { ftext = "Silenced 9mm"; }
                            else if(gun == 24) { ftext = "Desert Eagle"; }
                            else if(gun == 25) { ftext = "Shotgun"; }
                            else if(gun == 26) { ftext = "Sawn-off Shotgun"; }
                            else if(gun == 27) { ftext = "Combat Shotgun"; }
                            else if(gun == 28) { ftext = "Micro SMG"; }
                            else if(gun == 29) { ftext = "MP5"; }
                            else if(gun == 30) { ftext = "AK-47"; }
                            else if(gun == 31) { ftext = "M4"; }
                            else if(gun == 32) { ftext = "Tec9"; }
                            else if(gun == 33) { ftext = "Country Rifle"; }
                            else if(gun == 34) { ftext = "Sniper Rifle"; }
                            else if(gun == 35) { ftext = "Rocket Launcher"; }
                            else if(gun == 36) { ftext = "HS Rocket Launcher"; }
                            else if(gun == 37) { ftext = "Flamethrower"; }
                            else if(gun == 38) { ftext = "Minigun"; }
                            else if(gun == 41) { ftext = "Spraycan"; }
                            else if(gun == 42) { ftext = "Fire Extinguisher"; }
                            else if(gun == 43) { ftext = "Camera"; }
                            else if(gun == 44) { ftext = "Nightvision Goggle"; }
                            else if(gun == 45) { ftext = "Thermal Goggles"; }
                            else if(gun == 46) { ftext = "Parachutte"; }
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            GivePlayerWeapon(i, gun, ammo);
                            format(string, sizeof(string), "[EVENT]: %s has given a %s with %d ammo.",sendername,ftext,ammo);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
            }
        }
        return 1;
    }
    return 0;
}

senzaolo1xv.png

www.dsrclan.forumfree.it

Link to comment
Share on other sites

C:\Documents and Settings\x\Desktop\even.txt(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandText")

C:\Documents and Settings\x\Desktop\even.txt(3) : error 017: undefined symbol "strcmp"

C:\Documents and Settings\x\Desktop\even.txt(5) : error 017: undefined symbol "MAX_PLAYERS"

C:\Documents and Settings\x\Desktop\even.txt(7) : error 017: undefined symbol "IsPlayerConnected"

C:\Documents and Settings\x\Desktop\even.txt(9) : error 017: undefined symbol "PlayerInfo"

C:\Documents and Settings\x\Desktop\even.txt(9) : warning 215: expression has no effect

C:\Documents and Settings\x\Desktop\even.txt(9) : error 001: expected token: ";", but found "]"

C:\Documents and Settings\x\Desktop\even.txt(9) : error 029: invalid expression, assumed zero

C:\Documents and Settings\x\Desktop\even.txt(9) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

7 Errors.

Mersi ca incerci sa ma ajuti , e adevarat ca nu stiu script si ca sunt noob , dar usor usor invat :) Ai idee de ce da erorile astea ?

Link to comment
Share on other sites

C:\Documents and Settings\x\Desktop\even.txt(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandText")

C:\Documents and Settings\x\Desktop\even.txt(3) : error 017: undefined symbol "strcmp"

C:\Documents and Settings\x\Desktop\even.txt(5) : error 017: undefined symbol "MAX_PLAYERS"

C:\Documents and Settings\x\Desktop\even.txt(7) : error 017: undefined symbol "IsPlayerConnected"

C:\Documents and Settings\x\Desktop\even.txt(9) : error 017: undefined symbol "PlayerInfo"

C:\Documents and Settings\x\Desktop\even.txt(9) : warning 215: expression has no effect

C:\Documents and Settings\x\Desktop\even.txt(9) : error 001: expected token: ";", but found "]"

C:\Documents and Settings\x\Desktop\even.txt(9) : error 029: invalid expression, assumed zero

C:\Documents and Settings\x\Desktop\even.txt(9) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

7 Errors.

Mersi ca incerci sa ma ajuti , e adevarat ca nu stiu script si ca sunt noob , dar usor usor invat :) Ai idee de ce da erorile astea ?

#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])//Thx to Samy
{
if(strcmp(cmd, "/event", true) == 0)
    {
        for(new i=0; i<MAX_PLAYERS; i++)
    {
 if(IsPlayerConnected(playerid))
      {
        if(IsPlayerAdmin(playerid))
        {
              new x_nr[256];
                x_nr = strtok(cmdtext, idx);
                if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /event [heal,healall,gethere,giveweapon]");
                return 1;
                }
            if(strcmp(x_nr,"heal",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
                        if (ProxDetectorS(5.0, playerid, i))
                        {
                          if(IsPlayerConnected(i))
                          {
                              new amount;
                            tmp = strtok(cmdtext, idx);
                                amount = strval(tmp);
                                if(!strlen(tmp))
                                {
                                    SendClientMessage(playerid,COLOR_SYSTEM,"USAGE: /event heal [hp]");
                                    return 1;
                                }
                                GetPlayerName(playerid, sendername, sizeof(sendername));
                              SetPlayerHealth(i, amount);
                                format(string, sizeof(string), "[EVENT]: %s has setted everyones near him health at %d.",sendername,amount);
                                SendClientMessageToAll(COLOR_LIGHTRED, string);
                                return 1;
                            }
                        }
                    }
                }
             }
                if(strcmp(x_nr,"healall",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
                      if(IsPlayerConnected(i))
                      {
                        new amount;
                            tmp = strtok(cmdtext, idx);
                            amount = strval(tmp);
                            if(!strlen(tmp))
                            {
                                SendClientMessage(playerid,COLOR_SYSTEM,"USAGE: /event healall [hp]");
                                return 1;
                            }
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                        SetPlayerHealth(i, amount);
                            format(string, sizeof(string), "[EVENT]: %s has setted everyones health at %d.",sendername,amount);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
                if(strcmp(x_nr,"gethere",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
            if(IsPlayerConnected(i))
                    {
                          new Float:X, Float:Y, Float:Z;
                          GetPlayerPos(playerid, X,Y,Z);
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            if(GetPlayerState(i) == 2)
                            {
                            SetPlayerPos(i, X,Y+4,Z);
                            }
                            else
                            {
                              SetPlayerPos(i, X,Y+2,Z);
                            }
                            format(string, sizeof(string), "[EVENT]: %s had telported %d players at him.",sendername,PlayersOnline);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
                if(strcmp(x_nr,"givegun",true) == 0)
            {
                    for(new i; i < GetMaxPlayers(); i++)
                    {
                      if(IsPlayerConnected(i))
                      {
                          new gun,ammo;
                            tmp = strtok(cmdtext, idx);
                            gun = strval(tmp);
                            if(!strlen(tmp))
                            {
                                SendClientMessage(playerid, COLOR_GREY, "USAGE: /event givegun [gunid] [ammo]");
                                SendClientMessage(playerid, COLOR_GRAD1, "Melee I: Golf Club (2) | Nitestick (3) | Knife (4) | Baseball Bat (5)");
                                SendClientMessage(playerid, COLOR_GRAD1, "Melee I: Shovel (6) | Pool Cue (7) | Katana (8) | Chainsaw (9)");
                                SendClientMessage(playerid, COLOR_GRAD2, "Melee II: Purple Dildo (10) | Small White Vibrator (11) | Large White Vibrator (12)");
                  SendClientMessage(playerid, COLOR_GRAD2, "Melee II: Silver Vibrator (13) | Flowers (14) | Cane (15)");
                                SendClientMessage(playerid, COLOR_GRAD3, "Pistol: 9MM (22) | Sillenced 9MM (23) | Deagle (24)");
                                SendClientMessage(playerid, COLOR_GRAD4, "Shotgun: Shotgun (25)");
                                SendClientMessage(playerid, COLOR_GRAD5, "SMG: MP5 (29)");
                                SendClientMessage(playerid, COLOR_GRAD6, "Assault: AK-47 (30) | M4 (31)");
                                SendClientMessage(playerid, COLOR_WHITE, "Rifle: Country Rifle (33) | Sniper Rifle (34)");
                                return 1;
                            }
                            if(gun == 1 || gun >= 16 && gun <= 21 || gun == 26 || gun == 27 || gun == 28 || gun == 32 || gun >= 35 && gun <= 46)
                            {
                                SendClientMessage(playerid, COLOR_WHITE, "The WeaponID is wrong !");
                                return 1;
                            }
                            tmp = strtok(cmdtext, idx);
                            ammo = strval(tmp);
                            if(ammo <1 ||ammo > 999)
                            { SendClientMessage(playerid, COLOR_GRAD1, "dont go below 1 or above 999 bullets!"); return 1; }
                        new ftext[50];
                            if(gun == 1) { ftext = "Brass Knuckles"; }
                            else if(gun == 2) { ftext = "Golf Club"; }
                            else if(gun == 3) { ftext = "NightStick"; }
                            else if(gun == 4) { ftext = "Knife"; }
                            else if(gun == 5) { ftext = "Baseball Bat"; }
                            else if(gun == 6) { ftext = "Shovel"; }
                            else if(gun == 7) { ftext = "Pool Cue"; }
                            else if(gun == 8) { ftext = "Katana"; }
                            else if(gun == 9) { ftext = "Chainsaw"; }
                            else if(gun == 10) { ftext = "Purple Dildo"; }
                            else if(gun == 11) { ftext = "Small White Vibrator"; }
                            else if(gun == 12) { ftext = "Large White Vibrator"; }
                            else if(gun == 13) { ftext = "Silver Vibrator"; }
                            else if(gun == 14) { ftext = "Flowers"; }
                            else if(gun == 15) { ftext = "Cane"; }
                            else if(gun == 16) { ftext = "Grenade"; }
                            else if(gun == 17) { ftext = "Tear Gas"; }
                            else if(gun == 18) { ftext = "Molotov Cocktail"; }
                            else if(gun == 22) { ftext = "9MM"; }
                            else if(gun == 23) { ftext = "Silenced 9mm"; }
                            else if(gun == 24) { ftext = "Desert Eagle"; }
                            else if(gun == 25) { ftext = "Shotgun"; }
                            else if(gun == 26) { ftext = "Sawn-off Shotgun"; }
                            else if(gun == 27) { ftext = "Combat Shotgun"; }
                            else if(gun == 28) { ftext = "Micro SMG"; }
                            else if(gun == 29) { ftext = "MP5"; }
                            else if(gun == 30) { ftext = "AK-47"; }
                            else if(gun == 31) { ftext = "M4"; }
                            else if(gun == 32) { ftext = "Tec9"; }
                            else if(gun == 33) { ftext = "Country Rifle"; }
                            else if(gun == 34) { ftext = "Sniper Rifle"; }
                            else if(gun == 35) { ftext = "Rocket Launcher"; }
                            else if(gun == 36) { ftext = "HS Rocket Launcher"; }
                            else if(gun == 37) { ftext = "Flamethrower"; }
                            else if(gun == 38) { ftext = "Minigun"; }
                            else if(gun == 41) { ftext = "Spraycan"; }
                            else if(gun == 42) { ftext = "Fire Extinguisher"; }
                            else if(gun == 43) { ftext = "Camera"; }
                            else if(gun == 44) { ftext = "Nightvision Goggle"; }
                            else if(gun == 45) { ftext = "Thermal Goggles"; }
                            else if(gun == 46) { ftext = "Parachutte"; }
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            GivePlayerWeapon(i, gun, ammo);
                            format(string, sizeof(string), "[EVENT]: %s has given a %s with %d ammo.",sendername,ftext,ammo);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
            }
        }
        return 1;
    }
    return 0;
}

l-am pus sa fie pentru adminii RCON pentru ca nu e definit PlayerInfo + trebuia sus in script #include <a_samp>

Link to comment
Share on other sites

C:\Documents and Settings\x\Desktop\event.txt(4) : error 017: undefined symbol "cmd"

C:\Documents and Settings\x\Desktop\event.txt(13) : warning 217: loose indentation

C:\Documents and Settings\x\Desktop\event.txt(13) : error 017: undefined symbol "strtok"

C:\Documents and Settings\x\Desktop\event.txt(13) : error 033: array must be indexed (variable "x_nr")

C:\Documents and Settings\x\Desktop\event.txt(16) : error 017: undefined symbol "COLOR_WHITE"

C:\Documents and Settings\x\Desktop\event.txt(19) : warning 217: loose indentation

C:\Documents and Settings\x\Desktop\event.txt(21) : warning 219: local variable "i" shadows a variable at a preceding level

C:\Documents and Settings\x\Desktop\event.txt(23) : error 017: undefined symbol "ProxDetectorS"

C:\Documents and Settings\x\Desktop\event.txt(28) : warning 217: loose indentation

C:\Documents and Settings\x\Desktop\event.txt(28) : error 017: undefined symbol "tmp"

C:\Documents and Settings\x\Desktop\event.txt(28) : error 017: undefined symbol "strtok"

C:\Documents and Settings\x\Desktop\event.txt(29) : warning 217: loose indentation

C:\Documents and Settings\x\Desktop\event.txt(29) : error 017: undefined symbol "tmp"

C:\Documents and Settings\x\Desktop\event.txt(30) : error 017: undefined symbol "tmp"

C:\Documents and Settings\x\Desktop\event.txt(32) : error 017: undefined symbol "COLOR_SYSTEM"

C:\Documents and Settings\x\Desktop\event.txt(35) : error 017: undefined symbol "sendername"

C:\Documents and Settings\x\Desktop\event.txt(35) : error 017: undefined symbol "sendername"

C:\Documents and Settings\xDesktop\event.txt(35) : error 029: invalid expression, assumed zero

C:\Documents and Settings\x\Desktop\event.txt(35) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

14 Errors.

Cred ca sparg ceva pana la urma  :(

Link to comment
Share on other sites

C:\Documents and Settings\x\Desktop\event.txt(4) : error 017: undefined symbol "cmd"

C:\Documents and Settings\x\Desktop\event.txt(13) : warning 217: loose indentation

C:\Documents and Settings\x\Desktop\event.txt(13) : error 017: undefined symbol "strtok"

C:\Documents and Settings\x\Desktop\event.txt(13) : error 033: array must be indexed (variable "x_nr")

C:\Documents and Settings\x\Desktop\event.txt(16) : error 017: undefined symbol "COLOR_WHITE"

C:\Documents and Settings\x\Desktop\event.txt(19) : warning 217: loose indentation

C:\Documents and Settings\x\Desktop\event.txt(21) : warning 219: local variable "i" shadows a variable at a preceding level

C:\Documents and Settings\x\Desktop\event.txt(23) : error 017: undefined symbol "ProxDetectorS"

C:\Documents and Settings\x\Desktop\event.txt(28) : warning 217: loose indentation

C:\Documents and Settings\x\Desktop\event.txt(28) : error 017: undefined symbol "tmp"

C:\Documents and Settings\x\Desktop\event.txt(28) : error 017: undefined symbol "strtok"

C:\Documents and Settings\x\Desktop\event.txt(29) : warning 217: loose indentation

C:\Documents and Settings\x\Desktop\event.txt(29) : error 017: undefined symbol "tmp"

C:\Documents and Settings\x\Desktop\event.txt(30) : error 017: undefined symbol "tmp"

C:\Documents and Settings\x\Desktop\event.txt(32) : error 017: undefined symbol "COLOR_SYSTEM"

C:\Documents and Settings\x\Desktop\event.txt(35) : error 017: undefined symbol "sendername"

C:\Documents and Settings\x\Desktop\event.txt(35) : error 017: undefined symbol "sendername"

C:\Documents and Settings\xDesktop\event.txt(35) : error 029: invalid expression, assumed zero

C:\Documents and Settings\x\Desktop\event.txt(35) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

14 Errors.

Cred ca sparg ceva pana la urma  :(

Ma omule, citeste erorile, verifica wiki.sa-mp.com si da-ti seama ce inseamna, daca nu stii engleza nu mai incerca sa "scriptezi". Godfatherul nu este recomandat incepatorilor, incepe cu GM-uri freeroam ;)

Aici nu se cer scripturi, ci inveti sa scriptezi.

Uite aici rezolvat, dar nu cred ca v-a merge prea bine:

#include <a_samp>

#define COLOR_GRAD1 -1
#define COLOR_GRAD2 -1
#define COLOR_GRAD3 -1
#define COLOR_GRAD4 -1
#define COLOR_GRAD5 -1
#define COLOR_GRAD6 -1
#define COLOR_GREY -1
#define COLOR_WHITE -1
#define COLOR_LIGHTRED -1
#define COLOR_SYSTEM -1

public OnPlayerCommandText(playerid, cmdtext[])//Thx to Samy
{
	new cmd[128],idx,tmp[128],sendername[MAX_PLAYER_NAME],string[128];
	new x_nr[256];
 	x_nr = strtok(cmdtext, idx);
	cmd = strtok(cmdtext, idx);
	if(strcmp(cmd, "/event", true) == 0)
    {
        for(new i=0; i<MAX_PLAYERS; i++)
    	{
 			if(IsPlayerConnected(playerid))
      		{
		        if(IsPlayerAdmin(playerid))
		        {
                	if(!strlen(x_nr))
            		{
                		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /event [heal,healall,gethere,giveweapon]");
                		return 1;
                	}
            		if(strcmp(x_nr,"heal",true) == 0)
            		{
	                    for(i=0; i < GetMaxPlayers(); i++)
	                    {
	                        new Float:x,Float:y,Float:z;
	                        GetPlayerPos(i,x,y,z);
	                        if (IsPlayerInRangeOfPoint(playerid,5.0,x,y,z))
	                        {
	                          	if(IsPlayerConnected(i))
	                          	{
	                              	new amount;
	                            	tmp = strtok(cmdtext, idx);
	                                amount = strval(tmp);
	                                if(!strlen(tmp))
	                                {
	                                    SendClientMessage(playerid,COLOR_SYSTEM,"USAGE: /event heal [hp]");
	                                    return 1;
	                                }
	                                GetPlayerName(playerid, sendername, sizeof(sendername));
	                              	SetPlayerHealth(i, amount);
	                                format(string, sizeof(string), "[EVENT]: %s has setted everyones near him health at %d.",sendername,amount);
	                                SendClientMessageToAll(COLOR_LIGHTRED, string);
	                                return 1;
                            	}
                     		}
          				}
           			}
          		}
                if(strcmp(x_nr,"healall",true) == 0)
            	{
                    for(i=0; i < GetMaxPlayers(); i++)
                    {
                      	if(IsPlayerConnected(i))
                      	{
                        	new amount;
                            tmp = strtok(cmdtext, idx);
                            amount = strval(tmp);
                            if(!strlen(tmp))
                            {
                                SendClientMessage(playerid,COLOR_SYSTEM,"USAGE: /event healall [hp]");
                                return 1;
                            }
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                        	SetPlayerHealth(i, amount);
                            format(string, sizeof(string), "[EVENT]: %s has setted everyones health at %d.",sendername,amount);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                      	}
                    }
                }
                if(strcmp(x_nr,"gethere",true) == 0)
            	{
                    for(i=0; i < GetMaxPlayers(); i++)
                    {
            			if(IsPlayerConnected(i))
                    	{
                          	new Float:X, Float:Y, Float:Z;
                          	GetPlayerPos(playerid, X,Y,Z);
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            if(GetPlayerState(i) == 2)
                            {
                            	SetPlayerPos(i, X,Y+4,Z);
                            }
                            else
                            {
                              	SetPlayerPos(i, X,Y+2,Z);
                            }
                            format(string, sizeof(string), "[EVENT]: %s had telported all players at him.",sendername);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
                if(strcmp(x_nr,"givegun",true) == 0)
            	{
                    for(i=0; i < GetMaxPlayers(); i++)
                    {
                      	if(IsPlayerConnected(i))
                      	{
                          	new gun,ammo;
                            tmp = strtok(cmdtext, idx);
                            gun = strval(tmp);
                            if(!strlen(tmp))
                            {
                                SendClientMessage(playerid, COLOR_GREY, "USAGE: /event givegun [gunid] [ammo]");
                                SendClientMessage(playerid, COLOR_GRAD1, "Melee I: Golf Club (2) | Nitestick (3) | Knife (4) | Baseball Bat (5)");
                                SendClientMessage(playerid, COLOR_GRAD1, "Melee I: Shovel (6) | Pool Cue (7) | Katana (8) | Chainsaw (9)");
                                SendClientMessage(playerid, COLOR_GRAD2, "Melee II: Purple Dildo (10) | Small White Vibrator (11) | Large White Vibrator (12)");
                  				SendClientMessage(playerid, COLOR_GRAD2, "Melee II: Silver Vibrator (13) | Flowers (14) | Cane (15)");
                                SendClientMessage(playerid, COLOR_GRAD3, "Pistol: 9MM (22) | Sillenced 9MM (23) | Deagle (24)");
                                SendClientMessage(playerid, COLOR_GRAD4, "Shotgun: Shotgun (25)");
                                SendClientMessage(playerid, COLOR_GRAD5, "SMG: MP5 (29)");
                                SendClientMessage(playerid, COLOR_GRAD6, "Assault: AK-47 (30) | M4 (31)");
                                SendClientMessage(playerid, COLOR_WHITE, "Rifle: Country Rifle (33) | Sniper Rifle (34)");
                                return 1;
                            }
                            if(gun == 1 || gun >= 16 && gun <= 21 || gun == 26 || gun == 27 || gun == 28 || gun == 32 || gun >= 35 && gun <= 46)
                            {
                                SendClientMessage(playerid, COLOR_WHITE, "The WeaponID is wrong !");
                                return 1;
                            }
                            tmp = strtok(cmdtext, idx);
                            ammo = strval(tmp);
                            if(ammo <1 ||ammo > 999)
                            { SendClientMessage(playerid, COLOR_GRAD1, "dont go below 1 or above 999 bullets!"); return 1; }
                        	new ftext[50];
                            if(gun == 1) { ftext = "Brass Knuckles"; }
                            else if(gun == 2) { ftext = "Golf Club"; }
                            else if(gun == 3) { ftext = "NightStick"; }
                            else if(gun == 4) { ftext = "Knife"; }
                            else if(gun == 5) { ftext = "Baseball Bat"; }
                            else if(gun == 6) { ftext = "Shovel"; }
                            else if(gun == 7) { ftext = "Pool Cue"; }
                            else if(gun == 8) { ftext = "Katana"; }
                            else if(gun == 9) { ftext = "Chainsaw"; }
                            else if(gun == 10) { ftext = "Purple Dildo"; }
                            else if(gun == 11) { ftext = "Small White Vibrator"; }
                            else if(gun == 12) { ftext = "Large White Vibrator"; }
                            else if(gun == 13) { ftext = "Silver Vibrator"; }
                            else if(gun == 14) { ftext = "Flowers"; }
                            else if(gun == 15) { ftext = "Cane"; }
                            else if(gun == 16) { ftext = "Grenade"; }
                            else if(gun == 17) { ftext = "Tear Gas"; }
                            else if(gun == 18) { ftext = "Molotov Cocktail"; }
                            else if(gun == 22) { ftext = "9MM"; }
                            else if(gun == 23) { ftext = "Silenced 9mm"; }
                            else if(gun == 24) { ftext = "Desert Eagle"; }
                            else if(gun == 25) { ftext = "Shotgun"; }
                            else if(gun == 26) { ftext = "Sawn-off Shotgun"; }
                            else if(gun == 27) { ftext = "Combat Shotgun"; }
                            else if(gun == 28) { ftext = "Micro SMG"; }
                            else if(gun == 29) { ftext = "MP5"; }
                            else if(gun == 30) { ftext = "AK-47"; }
                            else if(gun == 31) { ftext = "M4"; }
                            else if(gun == 32) { ftext = "Tec9"; }
                            else if(gun == 33) { ftext = "Country Rifle"; }
                            else if(gun == 34) { ftext = "Sniper Rifle"; }
                            else if(gun == 35) { ftext = "Rocket Launcher"; }
                            else if(gun == 36) { ftext = "HS Rocket Launcher"; }
                            else if(gun == 37) { ftext = "Flamethrower"; }
                            else if(gun == 38) { ftext = "Minigun"; }
                            else if(gun == 41) { ftext = "Spraycan"; }
                            else if(gun == 42) { ftext = "Fire Extinguisher"; }
                            else if(gun == 43) { ftext = "Camera"; }
                            else if(gun == 44) { ftext = "Nightvision Goggle"; }
                            else if(gun == 45) { ftext = "Thermal Goggles"; }
                            else if(gun == 46) { ftext = "Parachutte"; }
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            GivePlayerWeapon(i, gun, ammo);
                            format(string, sizeof(string), "[EVENT]: %s has given a %s with %d ammo.",sendername,ftext,ammo);
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                            return 1;
                        }
                    }
                }
            }
        }
        return 1;
    }
    return 0;
}

strtok(const stringstrtok[], &index)
{
	new length = strlen(stringstrtok);
	while ((index < length) && (stringstrtok[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (stringstrtok[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = stringstrtok[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

Data viitoare posteaza aici: http://www.sa-mp.ro/forum/index.php/topic,5356.0.html daca mai e o problema de godfather.



Cine l-a ajutat, putea sa faca FS macar.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Similar Content

    • By faze amuzante
      Sakut, am inceput un edit la gamemode t4p si cand trag cu arma imi da server close the conections.V-a rog frumos sa m-a ajutati ❤️
      Multumesc aniticipat ! 

    • By faze amuzante
      Salut, ma poate ajuta cine sa nu se mai miste actor, cand dau cu masina peste el se misca
      codul:
          FondatorActor = CreateActor(211, 1803.1582,-1849.5033,13.5781,185.4817);
          SetActorInvulnerable(FondatorActor, true);
          //ApplyActorAnimation( "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0);
          ApplyActorAnimation(FondatorActor, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0);
          return 1;
      }
      Multumesc anticipat

    • By faze amuzante
      Salut, am si eu o problema, cand vreau sa m-a conectez pe server, si s-a bag parola imi spune ca mai am 2 incercari, fara sa fac nimic.Tin sa mentionez ca dupa ce bag parola nu am nici o problema, si nu nu apas pe nimic pe tastatura, imediat dupa ce m-am conectat imi apare, si nu reusesc sa ii dau de cap.V-a las o imagine mai jos.tin sa mentionez ca este gamemode burned
      Multumesc anticipat!

    • By faze amuzante
      Salut, cand dau /setadmin unui jucator acel jucator primeste functia dar dupa ce da relog nu mai are acea functie de admin, ajutorrr
      Multumesc Anticipat!
      COMANDA:
       
       
      YCMD:setadmin(playerid, params[], help) {
          new id, adminlevel, gString[120];
          if(PlayerInfo[playerid][pAdmin] < 6)
              return SCM(playerid, COLOR_WHITE, AdminOnly);
          if(sscanf(params, "ui", id, adminlevel))
              return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setadmin <playerid/name> <Admin Level>");
          if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID)
              return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
          if(adminlevel < 0 || adminlevel > 6)
              return SCM(playerid, COLOR_GREY, "Invalid admin level. 0-6");
          if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin])
              return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda pe acel player. Are admin level mai mare.");
          format(gString, 80, "Ai fost promovat la admin %d de %s", adminlevel, GetName(playerid));
          SCM(id, COLOR_LIGHTBLUE, gString);
          format(gString, 100, "AdmCmd: %s i-a setat lui %s admin level %d.", GetName(playerid), GetName(id), adminlevel);
          SendAdminHelperMessage(COLOR_LOGS, gString);
          if(adminlevel == 0) {
              PlayerInfo[id][pAW] = 0;
              UpdateVar(id, "AW", 0);
              SpecFaction[id] = 0;
              StopFly(playerid);
              UsedFly[playerid] = 0;
              SetPlayerHealthEx(playerid, 100);
              Iter_Remove(PlayerAdmins, id);
          }
          Iter_Add(PlayerAdmins, id);
          finishAchievement(id, 27);
          PlayerInfo[id][pAdmin] = adminlevel;
          new gQuery[180];
          if(adminlevel >= 1)
              format(gQuery, sizeof(gQuery), "UPDATE users SET `Admin`='%d', `Security`='%s', `HelpedPlayers`='0' WHERE `ID`='%d'", PlayerInfo[id][pAdmin]/*, MD5_Hash(DEFAULT_PASSWORD)*/, PlayerInfo[id][pSQLID]);
          else
              UpdateVar(id, "Admin", PlayerInfo[id][pAdmin]);
          mysql_tquery(SQL, gQuery, "", "");
          SetPVarInt(id, "SecurityPlayer", 0);
          return true;
      }
    • By faze amuzante
      Salut, are cineva idee cum fac un tabel gen tow vehicle sa fac un despawn vechicle. si as vrea daca ma poate ajuta cineva ca dupa ce ies de pe server sa se despawneze

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.