Tazer help?
#1

I get this

Код:
C:\Users\Nate\Desktop\Scract rp\gamemodes\rp(6060) : error 029: invalid expression, assumed zero
C:\Users\Nate\Desktop\Scract rp\gamemodes\rp6065) : warning 225: unreachable code
PHP код:
CMD:tazer(playeridparams[])
{
    new
    
string[128];
    
    if(
IsACop(playerid))
    if(
IsPlayerInAnyVehicle(playerid)) return SCM(playeridCOLOR_LIGHTRED"[SERVER]: You can't do this while you're in a vehicle.");
    if(
isAlive[playerid] > 0) return SCM(playeridCOLOR_LIGHTRED"[SERVER]: You can't do this while Dead!");
    if(
pTazer{playerid} == 0)
    {
        
pTazerReplace{playerid} = PlayerInfo[playerid][pWeapon1];
        
//if(PlayerInfo[playerid][pWeapon1][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pWeapon1][2]);
        
format(stringsizeof(string), "* %s unholsters their tazer."GetName(playerid));
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
GivePlayerWeapon(playerid23100);
        
pTazer{playerid} = 1;
    }
    else
    {
        
RemovePlayerWeapon(playerid23);
        
GivePlayerWeapon(playeridpTazerReplace{playerid}, 100);
        
format(stringsizeof(string), "* %s holsters their tazer."GetName(playerid));
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
pTazer{playerid} = 0;
    }
    else 
line 6060
    
{
        
SCM(playeridCOLOR_LIGHTRED"[SERVER]: You are not a Cop!");
        return 
1;
    }
    return 
1line 6065

Reply
#2

PHP код:




CMD
:tazer(playeridparams[])
{
    new
    
string[128];

//to check if payer is a cop thn use it like this
    
if(!IsACop(playerid))return SCM(playeridCOLOR_LIGHTRED"[SERVER]: You are not a Cop!");// <<<<<
    
if(IsPlayerInAnyVehicle(playerid)) return SCM(playeridCOLOR_LIGHTRED"[SERVER]: You can't do this while you're in a vehicle.");
    if(
isAlive[playerid] > 0) return SCM(playeridCOLOR_LIGHTRED"[SERVER]: You can't do this while Dead!");
    if(
pTazer{playerid} == 0)
    {
        
pTazerReplace{playerid} = PlayerInfo[playerid][pWeapon1];
        
//if(PlayerInfo[playerid][pWeapon1][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pWeapon1][2]);
        
format(stringsizeof(string), "* %s unholsters their tazer."GetName(playerid));
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
GivePlayerWeapon(playerid23100);
        
pTazer{playerid} = 1;
    }
    else
    {
        
RemovePlayerWeapon(playerid23);
        
GivePlayerWeapon(playeridpTazerReplace{playerid}, 100);
        
format(stringsizeof(string), "* %s holsters their tazer."GetName(playerid));
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
pTazer{playerid} = 0;
    }
    return 
1;

Reply
#3

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
PHP код:

CMD
:tazer(playeridparams[])
{
    new
    
string[128];
//to check if payer is a cop thn use it like this
    
if(!IsACop(playerid))return SCM(playeridCOLOR_LIGHTRED"[SERVER]: You are not a Cop!");// <<<<<
    
if(IsPlayerInAnyVehicle(playerid)) return SCM(playeridCOLOR_LIGHTRED"[SERVER]: You can't do this while you're in a vehicle.");
    if(
isAlive[playerid] > 0) return SCM(playeridCOLOR_LIGHTRED"[SERVER]: You can't do this while Dead!");
    if(
pTazer{playerid} == 0)
    {
        
pTazerReplace{playerid} = PlayerInfo[playerid][pWeapon1];
        
//if(PlayerInfo[playerid][pWeapon1][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pWeapon1][2]);
        
format(stringsizeof(string), "* %s unholsters their tazer."GetName(playerid));
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
GivePlayerWeapon(playerid23100);
        
pTazer{playerid} = 1;
    }
    else
    {
        
RemovePlayerWeapon(playerid23);
        
GivePlayerWeapon(playeridpTazerReplace{playerid}, 100);
        
format(stringsizeof(string), "* %s holsters their tazer."GetName(playerid));
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
pTazer{playerid} = 0;
    }
    return 
1;

Thx! rep!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)