#1

PHP код:
YCMD:find(playeridparams[], help) {
    if(
help) {
        
SendClientMessage(playeridX11_WHITE"LEO command for finding a player");
        return 
1;
    }
    if(!
IsAnLEO(playerid)) {
        
SendClientMessage(playeridX11_TOMATO_2"You aren't a cop!");
        return 
1;
    }
    if(!
IsOnDuty(playerid)) {
        
SendClientMessage(playeridX11_TOMATO_2"You are not on duty!");
        return 
1;
    }
    if(!
IsAtMDC(playerid)) {
        
SendClientMessage(playeridX11_TOMATO_2"You are not at a computer!");
        return 
1;
    }
    new 
playa;
    
/*new job = GetPVarInt(playerid, "Job");
    if(job != EJobType_Mercenary) {
        SendClientMessage(playerid, X11_TOMATO_2,"You must be a Mercenary");
        return 1;
    }*/
    
new time canUseMercCommand(playerid);
    new 
msg[128];
    if(
time != 0) {
        
format(msgsizeof(msg), "You must wait %d seconds before continuing",time);
        
SendClientMessage(playeridX11_TOMATO_2msg);
        return 
1;
    }
    if(!
sscanf(params"k<playerLookup>"playa)) {
        if(!
IsPlayerConnectEx(playa)) {
            
SendClientMessage(playeridX11_TOMATO_2"User not found");
            return 
1;
        }
        if(
GetPlayerState(playa) == PLAYER_STATE_SPECTATING || GetPlayerVirtualWorld(playa) != || GetPlayerInterior(playa) != || isTinFoiled(playa)) {
            
SendClientMessage(playeridX11_TOMATO_2"Could not locate player.");
            return 
1;
        }
        if(
EAdminFlags:GetPVarInt(playa"AdminFlags") & EAdminFlags_AdminManage) {
            
format(msgsizeof(msg), "%s has used /find on you.",GetPlayerNameEx(playeridENameType_RPName_NoMask));
            
SendClientMessage(playaX11_ORANGEmsg);
        }
        new 
Float:XFloat:YFloat:Z;
        
GetPlayerPos(playaXYZ);
        
SetPlayerCheckpoint(playeridXYZ3.0);
        
SetTimerEx("RemoveCheckpoint"getMercCheckpointTimeout(playerid), false"d"playerid);
        
SetPVarInt(playerid"LastMercCommand"gettime());
        
increaseJobPoints(playerid);
    } else {
        
SendClientMessage(playeridX11_WHITE"USAGE: /find [playerid/name]");
    }
    return 
1;

Hey I want to add this line:
PHP код:
if(getFactionType(faction) != EFactionType_Hitman) {
        
SendClientMessage(playeridX11_TOMATO_2"You aren't a member of hitman!");
        return 
1;
    } 
to the command above without restricting cops to be a hitman aswell.. like if isALEO they still can use the cmd and if it is a hitman he can use it aswell..
Reply
#2

We don't know how to get "faction" in your script to call:
Код:
if(getFactionType(faction) != EFactionType_Hitman) {
Reply
#3

Give it a try, if you meant playerid instead of faction in this line getFactionType(faction), then change it.
PHP код:
YCMD:find(playeridparams[], help) { 
    if(
help) { 
        
SendClientMessage(playeridX11_WHITE"LEO command for finding a player"); 
        return 
1
    } 
    if(
IsAnLEO(playerid) || (getFactionType(faction) == EFactionType_Hitman)) {             
        if(
IsOnDuty(playerid) || (getFactionType(faction) == EFactionType_Hitman)) { 
            if(
IsAtMDC(playerid)) { 
                new 
playa
                
/*new job = GetPVarInt(playerid, "Job"); 
                if(job != EJobType_Mercenary) { 
                    SendClientMessage(playerid, X11_TOMATO_2,"You must be a Mercenary"); 
                    return 1; 
                }*/ 
                
new time canUseMercCommand(playerid); 
                new 
msg[128]; 
                if(
time != 0) { 
                    
format(msgsizeof(msg), "You must wait %d seconds before continuing",time); 
                    
SendClientMessage(playeridX11_TOMATO_2msg); 
                    return 
1
                } 
                if(!
sscanf(params"k<playerLookup>"playa)) { 
                    if(!
IsPlayerConnectEx(playa)) { 
                        
SendClientMessage(playeridX11_TOMATO_2"User not found"); 
                        return 
1
                    } 
                    if(
GetPlayerState(playa) == PLAYER_STATE_SPECTATING || GetPlayerVirtualWorld(playa) != || GetPlayerInterior(playa) != || isTinFoiled(playa)) { 
                        
SendClientMessage(playeridX11_TOMATO_2"Could not locate player."); 
                        return 
1
                    } 
                    if(
EAdminFlags:GetPVarInt(playa"AdminFlags") & EAdminFlags_AdminManage) { 
                        
format(msgsizeof(msg), "%s has used /find on you.",GetPlayerNameEx(playeridENameType_RPName_NoMask)); 
                        
SendClientMessage(playaX11_ORANGEmsg); 
                    } 
                    new 
Float:XFloat:YFloat:Z
                    
GetPlayerPos(playaXYZ); 
                    
SetPlayerCheckpoint(playeridXYZ3.0); 
                    
SetTimerEx("RemoveCheckpoint"getMercCheckpointTimeout(playerid), false"d"playerid); 
                    
SetPVarInt(playerid"LastMercCommand"gettime()); 
                    
increaseJobPoints(playerid); 
                } else { 
                    
SendClientMessage(playeridX11_WHITE"USAGE: /find [playerid/name]"); 
                } 
                return 
1
            }
            return 
SendClientMessage(playeridX11_TOMATO_2"You are not on duty!"); 
        }
        return 
SendClientMessage(playeridX11_TOMATO_2"You aren't a cop!"); 
    }
    return 
1;

Reply
#4

It may work simply pasting the code into the cmd.

Lol this
PHP код:
SendClientMessage(playeridX11_TOMATO_2"You are not at a computer!"); 
Made my day.
Reply
#5

Quote:
Originally Posted by kAn3
Посмотреть сообщение
It may work simply pasting the code into the cmd.

Lol this
PHP код:
SendClientMessage(playeridX11_TOMATO_2"You are not at a computer!"); 
Made my day.
MDC ofc. xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)