Issue with a command [ZCMD]
#5

Command:
PHP код:
CMD:loc(playeridparams[]) 

    new 
giveplayeridstring[256], giveplayer[25]; 
    if(
sscanf(params"u"giveplayerid)) return SendClientMessage2(playeridCOLOR_ORANGE"Usage: /loc [playerid]"); 
    if (
GetPVarInt(playerid"playerorg") != 0
    { 
        if(!
IsALaw(playerid)) return SendClientMessage2(playeridCOLOR_RED"Error: You are not a law enforcer!"); 
    } 
    else return 
SendClientMessage2(playeridCOLOR_RED"Error: You are not a law enforcer!"); 
    if (
GetPVarInt(playerid"podfskin") == -1) return SendClientMessage2(playeridCOLOR_RED"{FF5357}Error: {FFFFFF}You are off duty."); 
    if (!
IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playeridCOLOR_RED"{FF5357}Error: {FFFFFF}Inactive player id!"); 
    
GetPlayerName(giveplayeridgiveplayerMAX_PLAYER_NAME); 
    if (
GetPlayerWantedLevel(giveplayerid) == 0) return SendPlayerFormattedText(playeridCOLOR_RED"{FF5357}Error: {FFFFFF}%s isn't a wanted player."giveplayer""); 
    if (
orcl[giveplayerid][0] != 0) return SendPlayerFormattedText(playeridCOLOR_RED"Error: %s isn't spawned."giveplayer""); 
    
SendClientMessage2(playeridCOLOR_WHITE"Requesting intel on suspect..."); 
    
SetTimerEx("LocTimer"5000false"ii"playeridgiveplayerid);   
    return 
1

Function
PHP код:
forward LocTimer(playerid,giveplayerid); //Here Is the created forward 
public LocTimer(playerid,giveplayerid//Here we are using the forward with the functions, which happen 5 seconds after typing the command 

    new 
giveplayer[64], string[80];
    
GetPlayerName(giveplayeridgiveplayerMAX_PLAYER_NAME);
    if (
playerZone[giveplayerid] > sizeof(zonenames)-11SendPlayerFormattedText(playeridCOLOR_WHITE"[Location] %s was last reported seen in %s."giveplayerzonenames[playerZone[giveplayerid]][z_name]); 
    else 
    { 
        
format(string128"[location] %s was last reported seen in %s, %s."giveplayerzonenames[playerZone[giveplayerid]][z_name], zonenames[sizeof(zonenames)-(zonetype[playerZone[giveplayerid]]+1)][z_name]); 
        
SendClientMessage2(playeridCOLOR_WHITEstring); 
    } 

Reply


Messages In This Thread
Issue with a command [ZCMD] - by ItzColaBoi - 29.10.2017, 11:46
Re: Issue with a command [ZCMD] - by kAn3 - 29.10.2017, 12:52
Re: Issue with a command [ZCMD] - by ItzColaBoi - 29.10.2017, 18:25
Re: Issue with a command [ZCMD] - by kAn3 - 29.10.2017, 23:09
Re: Issue with a command [ZCMD] - by IceBilizard - 30.10.2017, 05:27
Re: Issue with a command [ZCMD] - by ItzColaBoi - 30.10.2017, 08:11

Forum Jump:


Users browsing this thread: 2 Guest(s)