[Ajuda] Ajuda Tapete de prego.
#1

Galera, tenho um tapete de prego sу que qualquer um pode colocar, como faзo para apenas para policiais colocar?

Tapete de prego code:
Код:
#include <a_samp>
#include <SpikeStrip>

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;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[256];
	new idx;
	cmd = strtok(cmdtext, idx);

	if (strcmp(cmd,"/ctapete",true) == 0)
	{
	    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
        GetPlayerPos(playerid, plocx, plocy, plocz);
        GetPlayerFacingAngle(playerid,ploca);
        CreateStrip(plocx,plocy,plocz,ploca);
	    return 1;
	}
	else if (strcmp(cmd,"/rtapete",true) == 0)
	if(GetPlayerSkin(playerid) > 279 && GetPlayerSkin(playerid) < 289)
	{
        DeleteClosestStrip(playerid);
	    return 1;
	}
	else if (strcmp(cmd,"/removerall",true) == 0)
	if(GetPlayerSkin(playerid) > 279 && GetPlayerSkin(playerid) < 289)
	{
        DeleteAllStrip();
	    return 1;
	}
	
	return 0;
}
Reply
#2

Depende da formataзгo do seu GameMode cara. Й GodFather ?
Reply
#3

Se for GodFather coloca isso .
pawn Код:
if(IsPlayerConnected(playerid))
        {
            if(!IsACop(playerid))
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й um Cop !");
                return 1;
            }
Reply
#4

Nгo sei mano, isso й um [FS] sу quero que apenas policia podece colocar esse tapete olha, igual a esse fs..:

:
Quote:

#include <a_samp>
#include <core>
#include <float>


public OnPlayerCommandText(playerid, cmdtext)
{
if(!strcmp(cmdtext, "/escudo", true))
{
new Float:var0 = 0.0;
GetPlayerArmour(playerid, var0);
if(var0 > 0)
{
return SendClientMessage(playerid, 0xFDE39DAA, "Vocк Ja Esta Equipado!.");
}
if(GetPlayerSkin(playerid) > 279 && GetPlayerSkin(playerid) < 289)
{
SetPlayerAttachedObject(playerid, 1, 19142, 1, 1036831949, 1028443341, 0, 0, 0, 0, 1065353216, 1065353216, 1065353216);
SetPlayerAttachedObject(playerid, 2, 19141, 2, 1038174126, 0, 0, 0, 0, 0, 1065353216, 1065353216, 1065353216);
SetPlayerAttachedObject(playerid, 3, 18637, 13, 1051931443, 0, 0, 0, 0, 1127481344, 1065353216, 1065353216, 1065353216);
SetPlayerAttachedObject(playerid, 4, 18642, 7, 1036831949, 0, 3185657774, 0, 3266576384, 1119092736, 1065353216, 1065353216, 1065353216);
GivePlayerWeapon(playerid, 3, 1);
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, 0xFDE39DAA, "Equipamentos colocados!.");
}
else
{
SendClientMessage(playerid, 0xFDE39DAA, "Vocк Nao й Um Policial!.");
}
return 1;
}
return 0;
}

public OnPlayerUpdate(playerid)
{
new Float:var0 = 0.0;
GetPlayerArmour(playerid, var0);
if(var0 < 1)
{
RemovePlayerAttachedObject(playerid, 1);
}
return 1;
}

public OnFilterScriptExit()
{
for(new var0 = 0; var0 < 500; var0++)
{
RemovePlayerAttachedObject(var0, 1);
RemovePlayerAttachedObject(var0, 2);
RemovePlayerAttachedObject(var0, 3);
RemovePlayerAttachedObject(var0, 4);
}
return 1;
}

Reply
#5

N FOI :/
Reply
#6

Tinha esse cуdigo aqui, nem uso mais.. nao sei a situaзгo dele й antigao

ADAPTA ao GM

pawn Код:
if (strcmp("/escudo", cmdtext, true, 10) == 0)
    {
        if(PlayerInfo[playerid][pLeader] != 1 && PlayerInfo[playerid][pMember] != 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й LSPD.");
            return 0x01;
        }
        else if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6, 1748.5192,-1552.4083,-12.2411))
        {
            format(string, sizeof(string), "%s retira o seu escudo do armбrio e o coloca.", sendername);
            ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            SetPlayerHealth(playerid, 200);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк pode retirar o escudo a qualquer momento usando, /retiraritens.");
            EscudoFrente(playerid);
            return 0x01;
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й oficial ou nгo estб no Armбrio!");
            return 0x01;
        }
    }
    if (strcmp("/escudoc", cmdtext, true, 10) == 0)
    {
        if(PlayerInfo[playerid][pLeader] != 1 && PlayerInfo[playerid][pMember] != 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й LSPD.");
            return 0x01;
        }
        else if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6, 1748.5192,-1552.4083,-12.2411))
        {
            format(string, sizeof(string), "%s retira o seu escudo do armбrio e o coloca nas suas costas.", sendername);
            ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            EscudoCostas(playerid);
            return 0x01;
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й oficial ou nгo estб no Armбrio!");
            return 0x01;
        }
    }
    if (strcmp("/retiraritens", cmdtext, true, 10) == 0 || strcmp("/removeritens", cmdtext, true, 10) == 0)
    {
        if(PlayerInfo[playerid][pLeader] != 1 && PlayerInfo[playerid][pMember] != 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й LSPD.");
            return 0x01;
        }
        if (IsPlayerInRangeOfPoint(playerid, 6,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid, 6,223.6328,186.8251,1003.0313) || IsPlayerInRangeOfPoint(playerid, 6, 233.4989,123.6518,1003.2188) || IsPlayerInRangeOfPoint(playerid, 6, 1748.5192,-1552.4083,-12.2411))
        {
            format(string, sizeof(string), "%s guarda os seus itens no armбrio.", sendername);
            SetPlayerHealth(playerid, 100);
            ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
            if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
            return 0x01;
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo й oficial ou nгo estб no Armбrio!");
            return 0x01;
        }
    }
Reply
#7

Mano qual o nome do seu GameMode ? Qual era o nome que veio nele quando vocк baixo ?
Reply
#8

Quais sгo as variбveis do seu GameMod?
Reply
#9

dcmd_
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)