Help for gethere
#1

Hello, I want to make my /gethere command to get my PEvent and FEvent number and to set my number to teleported player.

Example: If my FEvent == 0 when I teleport player his FEvent to be 0

I hope you understand me

Here's the codes for /gethere

Код:
	if(strcmp(cmd, "/gethere", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gethere [Playerid/PartOfName]");
				return 1;
			}
			new Float:plocx,Float:plocy,Float:plocz;
			new plo;
			plo = ReturnUser(tmp);
			if (IsPlayerConnected(plo))
			{
			    if(plo != INVALID_PLAYER_ID)
			    {
					if (PlayerInfo[plo][pAdmin] > 1337)
					{
						SendClientMessage(playerid, COLOR_GRAD1, "Ask the admin to goto you.");
						return 1;
					}
					if (PlayerInfo[playerid][pAdmin] >= 4)
					{
						GetPlayerPos(playerid, plocx, plocy, plocz);
						SetPlayerVirtualWorld(plo, GetPlayerVirtualWorld(playerid));
						SetPlayerInterior(plo, GetPlayerInterior(playerid));
						if (GetPlayerState(plo) == 2)
						{
							TelePos[plo][0] = 0.0;
							TelePos[plo][1] = 0.0;
							new tmpcar = GetPlayerVehicleID(plo);
							SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
						}
						else
						{
							SetPlayerPos(plo,plocx,plocy+2, plocz);
						}
						SendClientMessage(plo, COLOR_GRAD1, "   You have been teleported");
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   You are not Admin!");
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player.", plo);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
Reply
#2

pawn Код:
if(strcmp(cmd, "/gethere", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gethere [Playerid/PartOfName]");
                return 1;
            }
            new Float:plocx,Float:plocy,Float:plocz;
            new plo;
            plo = ReturnUser(tmp);
            if (IsPlayerConnected(plo))
            {
                if(plo != INVALID_PLAYER_ID)
                {
                    if (PlayerInfo[plo][pAdmin] > 1337)
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, "Ask the admin to goto you.");
                        return 1;
                    }
                    if (PlayerInfo[playerid][pAdmin] >= 4)
                    {
                        FEvent[plo] == FEvent[playerid];//Like this??
                        GetPlayerPos(playerid, plocx, plocy, plocz);
                        SetPlayerVirtualWorld(plo, GetPlayerVirtualWorld(playerid));
                        SetPlayerInterior(plo, GetPlayerInterior(playerid));
                        if (GetPlayerState(plo) == 2)
                        {
                            TelePos[plo][0] = 0.0;
                            TelePos[plo][1] = 0.0;
                            new tmpcar = GetPlayerVehicleID(plo);
                            SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
                        }
                        else
                        {
                            SetPlayerPos(plo,plocx,plocy+2, plocz);
                        }
                        SendClientMessage(plo, COLOR_GRAD1, "   You have been teleported");
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, "   You are not Admin!");
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d is not an active player.", plo);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }
Reply
#3

Yes, thanks varthshenon
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)