Make Another Player Can't /goto Player Being In AFK +rep
#1

old thread.
Reply
#2

Hello.

PHP код:
CMD:goto(playerid,params[]) {
    if(
PlayerInfo[playerid][Level] >= || IsPlayerAdmin(playerid)) {
        if(
isnull(params)) return SendClientMessage(playerid,red,"USAGE: /goto [playerid]");
        new 
player1string[128];
        if(!
IsNumeric(params)) player1 ReturnPlayerID(params);
           else 
player1 strval(params);
         if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
        
//    CMDMessageToAdmins(playerid,"GOTO");
        
if(AFK[player1] == 1)
         {
            
SendClientMessage(player1,COLOR_ERROR,"This player's AFK.");
            return 
1;
          }
            new 
Float:xFloat:yFloat:z;    GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1));
            
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
            if(
GetPlayerState(playerid) == 2) {
                
SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);    LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
                
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
            } else 
SetPlayerPos(playerid,x+2,y,z);
            
format(string,sizeof(string),"You have teleported to \"%s\""pName(player1));
            return 
SendClientMessage(playerid,blue,string);
        } else return 
SendClientMessage(playeridred"Player is not connected or is yourself");
    } else return 
SendClientMessage(playerid,yellow,"ERROR: Level Anda Tidak Cukup Untuk Menggunakan Command Ini");

You should define the variable "AFK[player1]", which means that the target's AFK.

- KillerDVX.
Reply
#3

message appears on the player's AFK?

[Image: untitled.JPG]
Reply
#4

Because you are AFK ^^', Try it with your friend.
Reply
#5

I've tried it

i'm using command /goto and just look like this
[Image: dasd.JPG]

i'm using command /AFK,, Another player /goto to me, and a message like this
[Image: dsadsa.JPG]
Reply
#6

So change the variable above "AFK[player1]", to "AFK[playerid]".

- KillerDVX.
Reply
#7

PHP код:
SendClientMessage(player1,COLOR_ERROR,"This player's AFK."); 
to
PHP код:
SendClientMessage(playerid,COLOR_ERROR,"This player's AFK."); 
Reply
#8

Quote:
Originally Posted by KillerDVX
Посмотреть сообщение
So change the variable above "AFK[player1]", to "AFK[playerid]".

- KillerDVX.
Quote:
Originally Posted by MarvinPWN
Посмотреть сообщение
PHP код:
SendClientMessage(player1,COLOR_ERROR,"This player's AFK."); 
to
PHP код:
SendClientMessage(playerid,COLOR_ERROR,"This player's AFK."); 
THX Bro Problem Fixed +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)