COMMAND:afk(playerid,params[])
{
//do something here
}
COMMAND:afk(playerid,params[])
{
new Float: p[3] // this will be needed for the code below
GetPlayerPos(playerid, p[0], p[1], p[2]); //this code will take your player position
}
COMMAND:afk(playerid,params[])
{
new Float: p[3] // this will be needed for the code below
GetPlayerPos(playerid, p[0], p[1], p[2]); //this code will take your player position
SetPlayerVirtualWorld(playerid, 1331); //this fuction will teleport you for another virtual world
}
COMMAND:afk(playerid,params[])
{
new Float: p[3] // this will be needed for the code below
GetPlayerPos(playerid, p[0], p[1], p[2]); //this code will take your player position
SetPlayerVirtualWorld(playerid, 1331); //this fuction will teleport you for another virtual world
SetPlayerPos(playerid, p[0], p[1], p[2]); //this will place the player on the same place, but on the other virtual world
TogglePlayerControllable(playerid, 0); //this fuction will freeze you during the afk time.
SendClientMessage(playerid, -1, "You are afk, Please type '/back' to return."); //this will send the message to player informing to him he his afk
return 1;
}
new PlayerName[MAX_PLAYER_NAME], //this will be needed to take the player name
string[128]; //the string for the message
GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); //this will take the player name
format(string, sizeof(string), "%s is Now afk", PlayerName); // the message with the string
SendClientMessageToAll(0xFF0000AA, string); //the message
COMMAND:back(playerid,params[])
{
new Float: p[3]
GetPlayerPos(playerid, p[0], p[1], p[2]);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, p[0], p[1], p[2]);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, -1, "Welcome back!");
new PlayerName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s is Back!", PlayerName);
SendClientMessageToAll(0xFF0000AA, string);
return 1;
}
zcmd for one command, and even without params? I dont see any point of using zcmd here
|