Jump to content

Question

Posted

Care ma ajuta si pe mine sa fac 3 comenzi doar pentru politisti de rank 5?

#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,"/createstrip",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,"/removestrip",true) == 0)
	{
        DeleteClosestStrip(playerid);
	    return 1;
	}
	else if (strcmp(cmd,"/removeallstrip",true) == 0)
	{
        DeleteAllStrip();
	    return 1;
	}

	return 0;
}

3 answers to this question

Recommended Posts

Posted

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

{

        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)//in loc de 1 pui id factiunii

{

          if(PlayerInfo[playerid][pRank] >= 5)

  {

    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,"/removestrip",true) == 0)

{

        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)

{

          if(PlayerInfo[playerid][pRank] >= 5)

  {

            DeleteClosestStrip(playerid);

    return 1;

          }

        }

}

else if (strcmp(cmd,"/removeallstrip",true) == 0)

{

        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)

{

          if(PlayerInfo[playerid][pRank] >= 5)

  {

            DeleteAllStrip();

    return 1;

          }

        }

}

return 0;

}

vezi daca merge asa

metallica-logo.jpg
Posted

Chestie de RolePlay, deci

http://www.sa-mp.ro/forum/index.php/topic,5356.0.html

te asteapta.

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Guest
This topic is now closed to further replies.
×
×
  • 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.