How to insert?
#1

Hello friiends.i want to ask you how to insert this code :

Code:
	else if invited[playerid][GetPlayerVirtualWorld(playerid)] = true;
		SetPlayerPos(playerid, HouseInformation[x][TelePos][0], HouseInformation[x][TelePos][1], HouseInformation[x][TelePos][2]);
 		SetPlayerInterior(playerid, HouseInformation[x][interiors]);
 		SetPlayerVirtualWorld(playerid, 15500000 + x);
To here :

Code:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    for(new x; x<houseid; x++)
    {
        if(HouseInformation[x][checkpointidx][0] == checkpointid)
        {
            if(InHouse[playerid] != -1)
            {
                InHouse[playerid] = -1;
                return 1;
            }
            InHouseCP[playerid] = x;
            new Pname[28];
            GetPlayerName(playerid, Pname, 28);
            if(HouseInformation[x][owner][0] != 0 && !strcmp(Pname, HouseInformation[x][owner][0]))
            {
                SetPlayerPos(playerid, HouseInformation[x][TelePos][0], HouseInformation[x][TelePos][1], HouseInformation[x][TelePos][2]);
                SetPlayerInterior(playerid, HouseInformation[x][interiors]);
                SetPlayerVirtualWorld(playerid, 15500000 + x);
            }
            if(!HouseInformation[x][owner][0]) SendClientMessage(playerid, -1, "==|Sis namas parduodamas jei norite /npirkti!");
            return 1;
        }
        if(HouseInformation[x][checkpointidx][1] == checkpointid)
        {
            if(InHouse[playerid] == -1)
            {
                InHouse[playerid] = x;
                return 1;
            }
            SetPlayerPos(playerid, HouseInformation[x][EnterPos][0], HouseInformation[x][EnterPos][1], HouseInformation[x][EnterPos][2]);
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 0);
            return 1;
        }
    }
    return 1;
}
Reply
#2

any help
Reply
#3

pawn Code:
if(invited[playerid][GetPlayerVirtualWorld(playerid)] == true)
{
    SetPlayerPos(playerid, HouseInformation[x][TelePos][0], HouseInformation[x][TelePos][1], HouseInformation[x][TelePos][2]);
    SetPlayerInterior(playerid, HouseInformation[x][interiors]);
    SetPlayerVirtualWorld(playerid, 15500000 + x);
}
Reply
#4

Tag mismatch

Code:
if(kviestas[playerid][GetPlayerVirtualWorld(playerid)] == true)
Reply
#5

make it a bool


new bool:kviestas[MAX_PLAYERS];

instead of new kviestas[MAX_PLAYERS];
Reply
#6

thx helped but now ui have other problem when i type it i says player not exist : tokio zaidejo nera.

Code:
CMD:kviest(playerid, params[])
{
    new name[MAX_PLAYER_NAME];
	new id = GetPlayeridMid(name);
	if(id==INVALID_PLAYER_ID) return SendClientMessage(playerid,GREEN,"==|Klaida: Zaidejo nera!");
	kviestas[id][GetPlayerVirtualWorld(playerid)]=true;
	new kvietimas[24];
	GetPlayerName(playerid,name,MAX_PLAYER_NAME);
	format(kvietimas,sizeof(kvietimas),"==|%s pakviete i savo namus!",name);
	SendClientMessage(id,GREEN,kvietimas);
	GetPlayerName(id,name,MAX_PLAYER_NAME);
	format(kvietimas,sizeof(kvietimas),"==|Jei nori atsaukti kvietima :/nekviest %s",name,name);
	SendClientMessage(playerid,GREEN,kvietimas);
	return 1;
}
Reply
#7

ID isn't set to anything, which means its 0 by default.
You will have to set it to the id you want,

If the id is yourself use playerid.

Otherwise I recommend you using sscanf
Reply
#8

i need to do it like this /kviest playername
Reply
#9

pawn Code:
new id;
  if(!sscanf(params, "u", id))
{
//rest of the code here
Reply
#10

more explanation
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)