Help command
#1

How do I do the following? Instead of kicking you to the warning 3/3, i sent you to coordinates (jail)



PHP код:
public KickTimer(playerid)
{
    
Kick(playerid);
    return 
1;
}
CMD:warn(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return 0
    new 
giveplayeridreason[50]; 
    if(
sscanf(params"us[50]"giveplayeridreason)) return SendClientMessage(playerid0xFFFFFFFF"Correct usage: /warn [playerid/name] [reason]"); 
    if(
giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid0xFFFFFFFF"Player not connected.");
    new 
string[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridsendersizeof(sender)); 
    
GetPlayerName(giveplayeridreceiversizeof(receiver));
    
format(stringsizeof(string), "%s (%d) was warned by %s (%d), reason: %s (%d/3)"receivergiveplayeridsenderplayeridreasonWarns[giveplayerid]+1); 
    
SendClientMessageToAll(0x00FFFFFFstring); 
    if(
Warns[playerid] == 2)
    {
        
format(stringsizeof(string), "%s (%d) was automatically kicked, reason: had 3 warnings"receivergiveplayerid); 
        
SendClientMessageToAll(0x00FFFFFFstring);
        
SetTimerEx("KickTimer"1000false"i"giveplayerid);
    }
    else
    {
        
Warns[giveplayerid] ++;
        
GameTextForPlayer(giveplayerid"~r~warned~n~~w~check the chat"50006);
    }
    return 
1;

Reply
#2

if you want, create a command and place the code below to perform such action, or just put somewhere you want to use. Remember to replace (x, y, z) with the respective strings, and the playerid, for some variable that is storing the specific player's name or ID

pawn Код:
SetPlayerPos (playerid, x, y, z)
Reply
#3

remove this.

Код:
Kick(playerid);
Reply
#4

pawn Код:
public WarnJail(playerid)
{
    PlayerStats[playerid][jail] = 1;
    SetPlayerPos(playerid, x,y,z);
    return 1;
}


if(Warns[playerid] == 2)
    {
        format(string, sizeof(string), "%s (%d) was automatically jailed, reason: had 3 warnings", receiver, giveplayerid);  
        SendClientMessageToAll(0x00FFFFFF, string);
        // make something like this maybe?
        SetTimerEx("WarnJail", 1000, false, "i", giveplayerid);
    }
This is just example
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)