Quote:
Originally Posted by YouServ
Not more ? Else, it's why the player is teleported to 0.0 0.0 0.0.
SetPlayerPos(i, Player[i][pXp], Player[i][pY], Player[i][pZ]);
You call variable "Player[i][pXp]" but he is initialized to 0.0, where is the problem ? You have no bugs, just stupidity.
|
It's called pX, not pXp, and stupidity? Did you learn fast? So you were stupid that time you were still learning.
Can you tell me what to do now? And I want to be teleported back to the same coords where he was when he did /joinevent.
Код:
IRP:joinevent(playerid, var[])
{
if(!Logged(playerid)) return NoLogin(playerid);
if(Player[playerid][pEBanned]) return SendClientMessage(playerid, COLOR_GRAD2, "You are banned from joining events.");
if(IsPlayerTazed(playerid) && IsPlayerCuffed(playerid) && IsPlayerTied(playerid)) return SendClientMessage(playerid, COLOR_GRAD2, "You are not allowed to join events at the moment");
if(Player[playerid][pDead]) return SendClientMessage(playerid, COLOR_GRAD2, "You are not allowed to join the event while you are injured.");
if(Event[playerid]) return SendClientMessage(playerid, COLOR_GRAD2, "You are already in the event.");
if(!EventOn) return SendClientMessage(playerid, COLOR_GRAD2, "There's no current event happening.");
if(EventLocked) return SendClientMessage(playerid, COLOR_GRAD2, "The event is locked, be faster next time.");
if(EventType == 1)
{
Player[playerid][pInt] = GetPlayerInterior(playerid);
Player[playerid][pVW] = GetPlayerVirtualWorld(playerid);
GetPlayerPos(playerid, Player[playerid][pX], Player[playerid][pY], Player[playerid][pZ]);
GetPlayerHealth(playerid, Player[playerid][pHealth]);
GetPlayerArmour(playerid, Player[playerid][pArmor]);
SetPlayerPos(playerid, ePos[0], ePos[1], ePos[2]);
SetPlayerInterior(playerid, eInt);
SetPlayerVirtualWorld(playerid, eVW);
for(new i=0; i<13; i++)
{
GetPlayerWeaponData(playerid, i, Player[playerid][pWeapon][i], Player[playerid][pWeaponAmmo][i]);
}
GunsBeingRemoved[playerid] = 1;
ResetPlayerWeapons(playerid);
Event[playerid] = 1;
SendClientMessage(playerid, COLOR_LIGHTRED, "** Please wait until the event starts and you will recieve everything set by the organizer.");
SendClientMessage(playerid, COLOR_LIGHTRED, "** Your original health, armor and weapons will be refunded once you leave the event, /quitevent to leave at any time.");
}
else if(EventType == 2)
{
Player[playerid][pColor] = GetPlayerColor(playerid);
Player[playerid][pModel] = GetPlayerSkin(playerid);
Player[playerid][pInt] = GetPlayerInterior(playerid);
Player[playerid][pVW] = GetPlayerVirtualWorld(playerid);
GetPlayerPos(playerid, Player[playerid][pX], Player[playerid][pY], Player[playerid][pZ]);
GetPlayerHealth(playerid, Player[playerid][pHealth]);
GetPlayerArmour(playerid, Player[playerid][pArmor]);
SetPlayerPos(playerid, ePos[0], ePos[1], ePos[2]);
SetPlayerInterior(playerid, eInt);
SetPlayerVirtualWorld(playerid, eVW);
for(new i=0; i<13; i++)
{
GetPlayerWeaponData(playerid, i, Player[playerid][pWeapon][i], Player[playerid][pWeaponAmmo][i]);
}
GunsBeingRemoved[playerid] = 1;
ResetPlayerWeapons(playerid);
Event[playerid] = 1;
new rr = random(2);
if(rr == 1)
{
SetPlayerSkin(playerid, 230);
EventTeam[playerid] = 1;
}
else if(rr == 2)
{
SetPlayerSkin(playerid, 137);
EventTeam[playerid] = 2;
}
SendClientMessage(playerid, COLOR_LIGHTRED, "** Please wait until the event starts and you will recieve everything set by the organizer.");
SendClientMessage(playerid, COLOR_LIGHTRED, "** Your original health, armor and weapons will be refunded once you leave the event, /quitevent to leave at any time.");
SendClientMessage(playerid, COLOR_LIGHTRED, "** Please stay at your team base till the event starts.");
}
return 1;
}
Give me explained steps what to give you and what to do.
P.S.: Read your PMs.