Event Death Bug - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Event Death Bug (
/showthread.php?tid=524512)
Event Death Bug -
Timeless - 07.07.2014
PHP код:
CMD:mini(playerid,params[])
{
if (Mini[playerid] == 0)
{
GameTextForPlayer(playerid, "~r~MINIGUN DM!", 2000, 3);
SendClientMessage(playerid, COLOR_RED, "** Welcome to MINIGUN DM! type {00FF00} /leavemini{ffcc00} to leave the event" );
GetPlayerPos(playerid, xpos,ypos,zpos);
switch(random(4))
{
case 0:
{
SetPlayerPos(playerid,2604.4246,2726.2517,23.8222);
SendClientMessage(playerid,COLOR_RED,"You spawned at Sky Road (/skroad)");
}
case 1:
{
SetPlayerPos(playerid,2597.5359,2780.0967,23.8222);
SendClientMessage(playerid,COLOR_RED,"You spawned at aa. Old Airport (/aa)");
}
case 2:
{
SetPlayerPos(playerid,2608.2749,2731.7131,36.5386);
SendClientMessage(playerid,COLOR_RED,"You spawned at San Fierro (/sf)");
}
case 3:
{
SetPlayerPos(playerid,2643.5828,2776.2068,23.8222);
SendClientMessage(playerid,COLOR_RED,"You spawned at Los Santos (/ls)");
}
}
SetPlayerVirtualWorld(playerid, 1);
SetCameraBehindPlayer(playerid);
SetPlayerTeam(playerid, playerid);
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid, 100.0);
Mini[playerid] = 1;
}
if (IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
}
GivePlayerWeapon(playerid, 38, 99999);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(stringtele, sizeof(stringtele), "{FFFFFF}%s{6F94CC} has joined a Mini Gun Event!! using {5AD145}(/Mini){E9FA1D}", pname);
SendClientMessageToAll(COLOR_YELLOW, stringtele);
return 1;
}
when a player dies he spawns at my random spawn location but in the same world as the event and he can't spawn in world 0 on death how to fix this?
Re: Event Death Bug -
Jack_Leslie - 07.07.2014
pawn Код:
CMD:mini(playerid,params[])
{
if (Mini[playerid] == 0)
{
GameTextForPlayer(playerid, "~r~MINIGUN DM!", 2000, 3);
SendClientMessage(playerid, COLOR_RED, "** Welcome to MINIGUN DM! type {00FF00} /leavemini{ffcc00} to leave the event" );
GetPlayerPos(playerid, xpos,ypos,zpos);
switch(random(4))
{
case 0:
{
SetPlayerPos(playerid,2604.4246,2726.2517,23.8222);
SendClientMessage(playerid,COLOR_RED,"You spawned at Sky Road (/skroad)");
SetPlayerVirtualWorld(playerid, //putvirtualworldhere); ??
}
case 1:
{
SetPlayerPos(playerid,2597.5359,2780.0967,23.8222);
SendClientMessage(playerid,COLOR_RED,"You spawned at aa. Old Airport (/aa)");
SetPlayerVirtualWorld(playerid, //putvirtualworldhere); ??
}
case 2:
{
SetPlayerPos(playerid,2608.2749,2731.7131,36.5386);
SendClientMessage(playerid,COLOR_RED,"You spawned at San Fierro (/sf)");
SetPlayerVirtualWorld(playerid, //putvirtualworldhere); ??
}
case 3:
{
SetPlayerPos(playerid,2643.5828,2776.2068,23.8222);
SendClientMessage(playerid,COLOR_RED,"You spawned at Los Santos (/ls)");
SetPlayerVirtualWorld(playerid, //putvirtualworldhere); ??
}
}
Re: Event Death Bug -
Timeless - 07.07.2014
that worked for spawning back in virtual world 0 but can you put it so they can spawn back in the same event instead of out? cause i already have a /leave command that works 100% and when your outside the dm whether 0 0r 1 you can't go back with /mini :S