Jump to content

[REZOLVAT] Comanda /spawnhere


equin0x
 Share

Recommended Posts

  • Administrator

Pentru aceasta comanda ai nevoie de Libraria YSI, mai exact de y_timers,

 

Comanda:

YCMD:spawnhere(playerid, params[], help) {
	if(!PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, -1, "Nu esti administrator");

	new id;
	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: {FFFFFF}/spawnhere [playerid/name]");
	if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Jucator neconectat.");

	new string[128];
	foreach(new x : Player) {
		if(PlayerInfo[x][pAdmin]) {
			format(string, sizeof string, "AdmCMD: %s has spawned %s and restored his position.",GetName(playerid), GetName(id));
			SendClientMessage(x, -1, string);
		}
	}

	format(string, sizeof string, "L-ai respawnat pe %s si i-ai resetat pozitia.", GetName(id));
	SendClientMessage(playerid, -1, string);

	format(string, sizeof string, "Administratorul %s te-a respawnat si ti-a resetat pozitia.", GetName(playerid));
	SendClientMessage(id, -1, string);

	new Float: x, Float: y, Float: z; GetPlayerPos(id, x, y, z); 
	SpawnPlayer(id); 
	defer afterSpawnHere(id, x, y, z, GetPlayerInterior(id), GetPlayerVirtualWorld(id));
	return 1;
}

timer afterSpawnHere[1000](playerid, Float: x, Float: y, Float: z, interior, virtualworld) {
	return SetPlayerPos(playerid, x, y, z), SetPlayerInterior(playerid, interior), SetPlayerVirtualWorld(playerid, virtualworld);
}
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...