Checking if player is in ....
#1

Why does this script give tasers to everyone , i'm trying that faction id 1 member could use it .

Код:
cmd(tazer, playerid, params[])
{
	new string[28+MAX_PLAYER_NAME];
	if(Tazer[playerid] == 0)
	{
        if(PlayerInfo[playerid][pFaction] == 1)
		{
		SendClientMessage(playerid, -1, "You cannot use this command.");
		}
		GivePlayerWeapon(playerid, 23, 9999);
		format(string, sizeof(string),"%s has unholstered his tazer.", RemoveUnderScore(playerid));
		ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
		Tazer[playerid] = 1;
	}
	else
	{
		SetPlayerAmmo(playerid, 23, 0);
		format(string, sizeof(string),"%s has holstered his tazer.", RemoveUnderScore(playerid));
		Tazer[playerid] = 0;
		ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
	}
	return 1;
}
Reply
#2

PHP код:
cmd(tazerplayeridparams[])
{
    new 
string[28+MAX_PLAYER_NAME];
    if(
Tazer[playerid] == 0)
    {
        if(
PlayerInfo[playerid][pFaction] == 1) return SendClientMessage(playerid, -1"You cannot use this command.");

        
GivePlayerWeapon(playerid239999);
        
format(stringsizeof(string),"%s has unholstered his tazer."RemoveUnderScore(playerid));
        
ProxDetector(30.0playeridstringPURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
        
Tazer[playerid] = 1;
    }
    else
    {
        
SetPlayerAmmo(playerid230);
        
format(stringsizeof(string),"%s has holstered his tazer."RemoveUnderScore(playerid));
        
Tazer[playerid] = 0;
        
ProxDetector(30.0playeridstringPURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
    }
    return 
1;

Reply
#3

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
PHP код:
cmd(tazerplayeridparams[])
{
    new 
string[28+MAX_PLAYER_NAME];
    if(
Tazer[playerid] == 0)
    {
        if(
PlayerInfo[playerid][pFaction] == 1) return SendClientMessage(playerid, -1"You cannot use this command.");
        
GivePlayerWeapon(playerid239999);
        
format(stringsizeof(string),"%s has unholstered his tazer."RemoveUnderScore(playerid));
        
ProxDetector(30.0playeridstringPURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
        
Tazer[playerid] = 1;
    }
    else
    {
        
SetPlayerAmmo(playerid230);
        
format(stringsizeof(string),"%s has holstered his tazer."RemoveUnderScore(playerid));
        
Tazer[playerid] = 0;
        
ProxDetector(30.0playeridstringPURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
    }
    return 
1;

still gives everyone ...
Reply
#4

lol sorry
PHP код:
cmd(tazerplayeridparams[]) 

    new 
string[28+MAX_PLAYER_NAME]; 
        if(
PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, -1"You cannot use this command."); 
    if(
Tazer[playerid] == 0
    { 
        
GivePlayerWeapon(playerid239999); 
        
format(stringsizeof(string),"%s has unholstered his tazer."RemoveUnderScore(playerid)); 
        
ProxDetector(30.0playeridstringPURPLE,PURPLE,PURPLE,PURPLE,PURPLE); 
        
Tazer[playerid] = 1
    } 
    else 
    { 
        
SetPlayerAmmo(playerid230); 
        
format(stringsizeof(string),"%s has holstered his tazer."RemoveUnderScore(playerid)); 
        
Tazer[playerid] = 0
        
ProxDetector(30.0playeridstringPURPLE,PURPLE,PURPLE,PURPLE,PURPLE); 
    } 
    return 
1

Reply
#5

You mean, it gives a silenced pistol to everyone?
Reply
#6

Код:
 cmd(tazer, playerid, params[])
{
	new string[28+MAX_PLAYER_NAME];
        if(PlayerInfo[playerid][pFaction] == 1) return SendClientMessage(playerid, -1, "You cannot use this command.");
	if(Tazer[playerid] == 0)
	{
		GivePlayerWeapon(playerid, 23, 9999);
		format(string, sizeof(string),"%s has unholstered his tazer.", RemoveUnderScore(playerid));
		ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
		Tazer[playerid] = 1;
	}
	else
	{
		SetPlayerAmmo(playerid, 23, 0);
		format(string, sizeof(string),"%s has holstered his tazer.", RemoveUnderScore(playerid));
		Tazer[playerid] = 0;
		ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
	}
	return 1;
}
This;ll do it I hope
Reply
#7

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
lol sorry
PHP код:
cmd(tazerplayeridparams[]) 

    new 
string[28+MAX_PLAYER_NAME]; 
        if(
PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, -1"You cannot use this command."); 
    if(
Tazer[playerid] == 0
    { 
        
GivePlayerWeapon(playerid239999); 
        
format(stringsizeof(string),"%s has unholstered his tazer."RemoveUnderScore(playerid)); 
        
ProxDetector(30.0playeridstringPURPLE,PURPLE,PURPLE,PURPLE,PURPLE); 
        
Tazer[playerid] = 1
    } 
    else 
    { 
        
SetPlayerAmmo(playerid230); 
        
format(stringsizeof(string),"%s has holstered his tazer."RemoveUnderScore(playerid)); 
        
Tazer[playerid] = 0
        
ProxDetector(30.0playeridstringPURPLE,PURPLE,PURPLE,PURPLE,PURPLE); 
    } 
    return 
1

works +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)