[FilterScript] Scarf for RolePlay Servers
#1

A Scarf object
Код:
 	if (strcmp("/scarf", cmdtext, true, 10) == 0)
	{
			if(maramawearg[playerid] == 0)
   			{
	    		SetPlayerAttachedObject(playerid, 3, 18912, 2, -0.08, 0.03, 0.0, 90, -180, -90); //marama
	    		maramawearg[playerid] = 1;
	    		SendClientMessage(playerid, WHITE, "{37F906}INFO:{FFFFFF}You have put the scarf on your face.");
	    		GetPlayerName(playerid, sendername, sizeof(sendername));
	    		format(string, sizeof(string), "* %s takes the scarf and puts it on his face", sendername);
				ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
		}
		else
		{
		    SendClientMessage(playerid, WHITE, "{FF0000}GRESKA:{FFFFFF}Ne ste clen na banda/mafija!");
		}
		return 1;
 	}
 	if (strcmp("/takescarf", cmdtext, true, 10) == 0)
	{
			if(maramawearg[playerid] == 1)
			{
				RemovePlayerAttachedObject(playerid,3);
		        maramawearg[playerid] = 0;
	 			SendClientMessage(playerid, WHITE, "{37F906}INFO:{FFFFFF}You have take out the scarf from your face.");
	 			GetPlayerName(playerid, sendername, sizeof(sendername));
	 			format(string, sizeof(string), "* %s puts out the scarf from his face.", sendername);
				ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
		}
		return 1;
	}
Reply
#2

missing codes:

pawn Код:
new maramawearg[MAX_PLAYERS];
new sendername[MAX_PLAYER_NAME];
pawn Код:
#define WHITE (-1)
#define COLOR_PURPLE (0x800080C8)
pawn Код:
forward ProxDetector(Float:radi, playerid, str[], col1, col2, col3, col4, col5);

public ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        //radi = 2.0; //Trigger Radius
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {

                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
                if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                {
                    SendClientMessage(i, col1, str);
                }
                else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                {
                    SendClientMessage(i, col2, str);
                }
                else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                {
                    SendClientMessage(i, col3, str);
                }
                else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                {
                    SendClientMessage(i, col4, str);
                }
                else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                {
                    SendClientMessage(i, col5, str);
                }
            }
        }
    }//not connected
    return 1;
}
Reply
#3

Quote:
Originally Posted by Hwang
Посмотреть сообщение
missing codes:

pawn Код:
new maramawearg[MAX_PLAYERS];
new sendername[MAX_PLAYER_NAME];
pawn Код:
#define WHITE (-1)
#define COLOR_PURPLE (0x800080C8)
pawn Код:
forward ProxDetector(Float:radi, playerid, str[], col1, col2, col3, col4, col5);

public ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        //radi = 2.0; //Trigger Radius
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {

                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
                if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                {
                    SendClientMessage(i, col1, str);
                }
                else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                {
                    SendClientMessage(i, col2, str);
                }
                else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                {
                    SendClientMessage(i, col3, str);
                }
                else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                {
                    SendClientMessage(i, col4, str);
                }
                else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                {
                    SendClientMessage(i, col5, str);
                }
            }
        }
    }//not connected
    return 1;
}
Forgoted to added them ..
Reply
#4

Seriosly?
Reply
#5

hahaha forget to add them.. Anyway not bad just edit the code
Reply
#6

screenshot?? please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)