Detect VirtualW (IsPlayerInRangePoint)
#1

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 1.0, -1542.1699,-427.8311,5.8516))
    {
        SendClientMessage(playerid,0xFFFFFFFF,"Ganaste la carrera! Felicidades!!");
    }
Reply
#2

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 1.0, -1542.1699,-427.8311,5.8516) && GetPlayerVirtualWorld(playerid) == your_virtual_world)
    {
        SendClientMessage(playerid,0xFFFFFFFF,"Ganaste la carrera! Felicidades!!");
    }
Is this what you meant?
Reply
#3

How about this:

I want to check who is in the virtual world 9
pawn Код:
CMD:enevento(playerid,params[])
{
        new bool:First2 = false;
        new PlayerName2;
        new id;
        GetPlayerName(id,PlayerName2,MAX_PLAYER_NAME);
        new Count, string[128];
   
        for(id = 0; id < MAX_PLAYERS; id++)
        {
            if(IsPlayerConnected(id))
            {
            if(GetPlayerVirtualWorld(playerid) == 9)
            {
            Count++;
            if(!First2)
            {
            format(string, sizeof(string), "(ID: %d) (Name: %s)", id, PlayerName2);
            First2 = true;
            }
            else format(string,sizeof(string),"%s, (ID: %d) (Name: %s)",string, id, PlayerName2);
            }
            }
            }
        }
        if(Count == 0)
        return SendClientMessage(playerid,COLOR_WHITE,"No hay personas en el evento!");
        else return SendClientMessage(playerid,COLOR_WHITE,string);
    }
    else return;
}
Reply
#4

pawn Код:
CMD:enevento(playerid,params[])
{
        new bool:First2 = false;
        new PlayerName2;
        new id;
        GetPlayerName(id,PlayerName2,MAX_PLAYER_NAME);
        new Count, string[128];
   
        for(id = 0; id < MAX_PLAYERS; id++)
        {
            if(IsPlayerConnected(id))
            {
            if(GetPlayerVirtualWorld(id) == 9)
            {
            Count++;
            if(!First2)
            {
            format(string, sizeof(string), "(ID: %d) (Name: %s)", id, PlayerName2);
            First2 = true;
            }
            else format(string,sizeof(string),"%s, (ID: %d) (Name: %s)",string, id, PlayerName2);
            }
            }
            }
        }
        if(Count == 0)
        return SendClientMessage(playerid,COLOR_WHITE,"No hay personas en el evento!");
        else return SendClientMessage(playerid,COLOR_WHITE,string);
    }
    else return;
}
Reply
#5

pawn Код:
C:\Users\Alex\Documents\GTA San Andreas User Files\SAMP\SAMP\Bot\filterscripts\TEST2.pwn(284) : error 035: argument type mismatch (argument 2)
C:\Users\Alex\Documents\GTA San Andreas User Files\SAMP\SAMP\Bot\filterscripts\TEST2.pwn(304) : error 010: invalid function or declaration
C:\Users\Alex\Documents\GTA San Andreas User Files\SAMP\SAMP\Bot\filterscripts\TEST2.pwn(305) : error 010: invalid function or declaration
C:\Users\Alex\Documents\GTA San Andreas User Files\SAMP\SAMP\Bot\filterscripts\TEST2.pwn(306) : error 010: invalid function or declaration
C:\Users\Alex\Documents\GTA San Andreas User Files\SAMP\SAMP\Bot\filterscripts\TEST2.pwn(308) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Reply
#6

pawn Код:
CMD:enevento(playerid,params[])
{
    new pName[MAX_PLAYER_NAME], id, Count = 0, string[64];
    for(id = 0; id < MAX_PLAYERS; id++)
    {
        if(IsPlayerConnected(id) && GetPlayerVirtualWorld(id) == 9)
        {
            Count++;
            GetPlayerName(id, pName, MAX_PLAYER_NAME);
            if(Count == 1)
            {
                format(string, sizeof(string), "(ID: %d) (Name: %s)", id, pName);
            }
            else format(string, sizeof(string),"%s, (ID: %d) (Name: %s)", string, id, pName);
        }
    }
    if(Count == 0) SendClientMessage(playerid, -1, "No hay personas en el evento!");
    else SendClientMessage(playerid, -1, string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)