Posts: 312
Threads: 83
Joined: Feb 2012
Reputation:
0
Well, How can i put interior name
For example:
Player A in Ammunation of Sf ocean flat.
So it should be like this:
Location: Ocean Flat (Ammunation) <==
Location: Market (Ammunation) <==
or if Player A in Pizza shop
Location: Ocean Flat (PizzaShop) <==
How can i set Interior name?
Posts: 561
Threads: 27
Joined: Sep 2012
I'm not pretty sure, but you can try this :
PHP код:
public OnGameModeInit()
{
SetTimer("CheckInterior",3000,1);
return 1;
}
forward CheckInterior(playerid);
public CheckInterior(playerid)
{
new string[128];
format(string, sizeof(string), "You are in : %i", GetPlayerInterior(playerid));
GameTextForPlayer(playerid, string, 3000, 5);
}
Posts: 1,276
Threads: 6
Joined: Aug 2014
24.06.2015, 13:32
(
Последний раз редактировалось J0sh...; 24.06.2015 в 13:46.
Причина: RETURN 1; Outside the brackets.
)
Quote:
Originally Posted by KillerDVX
I'm not pretty sure, but you can try this :
PHP код:
public OnGameModeInit()
{
SetTimer("CheckInterior",3000,1);
return 1;
}
forward CheckInterior(playerid);
public CheckInterior(playerid)
{
new string[128];
format(string, sizeof(string), "You are in : %i", GetPlayerInterior(playerid));
GameTextForPlayer(playerid, string, 3000, 5);
}
|
Didn't issue the playerid. Should be onplayerconnect with the "i", playerid); parameter with SetTimerEx. He wants the name, if he wants the number he could of done /interior.
@OP, You could use OnInterior change for a player and use something like this:
PHP код:
GetInteriorName(playerid)
{
switch(GetPlayerInterior(playerid))
{
case 1: format(..
}
return 1;
}
case 1 and that are interiors.
Posts: 561
Threads: 27
Joined: Sep 2012
Quote:
Originally Posted by AndySedeyn
That ^.
@KillerDVX, why do you declare that variable with a size of 128 bits? The string's maximum size is approx. 15 characters ( = 15 bits). That's a total waste of 113 bits!
|
Oh.. My fault said so ^^'.
Thanks for the recall .
KillerDVX,
Posts: 312
Threads: 83
Joined: Feb 2012
Reputation:
0
Well, I have 3 ammunations and different VirtualWorld. So, How can i set name them?
I mean
I have an ammunation in Angel Pine
Ammunation in Oceal Flat
Ammunation in EL Q
... is this possible i can set interior names by checkpoint? if yes please post some codes.
Posts: 1,276
Threads: 6
Joined: Aug 2014
Quote:
Originally Posted by STONEGOLD
Well, I have 3 ammunations and different VirtualWorld. So, How can i set name them?
I mean
I have an ammunation in Angel Pine
Ammunation in Oceal Flat
Ammunation in EL Q
|
PHP код:
GetInteriorName(playerid)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(GetPlayerInterior(playerid) == .. && x == .. && ..)
{
format(..
}
else if(..
return 1;
}