04.10.2016, 16:37
PHP код:
CMD:setvw(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
new giveplayerid, vw;
if(sscanf(params, "ud", giveplayerid, vw)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setvw [player] [virtual world]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
new string[128];
if(GetPVarInt(giveplayerid, "IsInArena") >= 0)
{
SetPVarInt(playerid, "tempPBP", giveplayerid);
format(string, sizeof(string), "%s (ID: %d) is currently in an active Paintball game.\n\nDo you want to force this player out?", GetPlayerNameEx(giveplayerid), giveplayerid);
ShowPlayerDialog(playerid, PBFORCE, DIALOG_STYLE_MSGBOX, "Paintball", string, "Yes", "No");
return 1;
}
PlayerInfo[giveplayerid][pVW] = vw;
SetPlayerVirtualWorld(giveplayerid, vw);
format(string, sizeof(string), "You have set %s's virtual world to %d.", GetPlayerNameEx(giveplayerid), vw);
SendClientMessageEx(playerid, COLOR_GRAD2, string);
return 1;
}