pawn Code:
CMD:world(playerid, params[])
{
if(GetPVarInt(playerid, "VirtualWorld") > 0)
return SendClientMessage(playerid, -1, "You are already in a separate world. Use /normalworld.");
new vworld = random(99999), str[40];
SetPlayerVirtualWorld(playerid, vworld);
SetPVarInt(playerid, "VirtualWorld", vworld);
format(str, sizeof str, "You are now in virtual world %d.", vWorld);
SendClientMessage(playerid, -1,str);
return 1;
}
CMD:normalworld(playerid, params[])
{
if(GetPVarInt(playerid, "VirtualWorld") == 0)
return SendClientMessage(playerid, -1, "You're not in a separate world. Use /world first.");
DeletePVar(playerid, "VirtualWorld");
SetPlayerVirtualWorld(playerid, 0);
SendClientMessage(playerid, -1, "You're now back in the normal world.");
return 1;
}
CMD:inviteworld(playerid, params[])
{
new pID, vworld, str[80];
if(GetPVarInt(playerid, "VirtualWorld") == 0)
return SendClientMessage(playerid, -1, "You're not in a separate world, use /world first.");
if(sscanf(params,"u",pID))
return SendClientMessage(playerid,-1,"USAGE: /inviteworld [PlayerID]");
if(!IsPlayerConnected(pID))
return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");
vworld = GetPVarInt(playerid, "VirtualWorld");
SetPVarInt(pID, "WorldInvite", vworld);
format(str, sizeof str, "You've been invited in world %i by someone. Type /accept to join the world.", vworld);
SendClientMessage(pID, -1, str);
format(str, sizeof str, "You invited selected player in world %i.", vworld);
SendClientMessage(playerid, -1, str);
return 1;
}
CMD:accept(playerid, params[])
{
if(GetPVarInt(playerid, "WorldInvite") < 1)
return SendClientMessage(playerid, -1, "Noone invited you in a separate world.");
new vworld = GetPVarInt(playerid, "WorldInvite");
new str[80];
SetPlayerVirtualWorld(playerid, vworld);
SetPVarInt(playerid, "VirtualWorld", vworld);
format(str, sizeof str, "You accepted to join world %i.", vworld);
SendClientMessage(playerid, -1, str);
DeletePVar(playerid, "WorldInvite");
return 1;
}
This should help you or at least give you a clue, where to start from or how to make it. Hope it helped !