Help - it's really easy for you, but hard for me.
#1

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/enter", cmdtext, true, 10) == 0)
	{
    (IsPlayerInRangeOfPoint(playerid, 1.0, 172.66, -152.10, 1.72)); // checks if in range of the /enter point

        SetPlayerPos(playerid, 170.75, -153.94, 1.81); //Sets there new position
		RemoveObjectVar2 = RemoveBuilding(12923, 158.3594, -176.3047, 5.5703, 0.25);
		RemoveObjectVar2 = RemoveBuilding(12923, 158.3594, -176.3047, 5.5703, 0.25);
		RemoveObjectVar2 = RemoveBuilding(12923, 158.3594, -176.3047, 5.5703, 0.25);
				        return 1;
    }
   if (strcmp("/exit", cmdtext, true, 10) == 0)
   {
   if(IsPlayerInRangeOfPoint(playerid, 1.0, 170.85, -153.85, 1.48)) // Checks if near the exit door
    {
               SetPlayerPos(playerid, 172.24, -152.26, 1.81);
               RestoreBuilding(RemoveObjectVar2);
               RestoreBuilding(RemoveObjectVar2);
               RestoreBuilding(RemoveObjectVar2);
    }
    return 1;
}
What I want is for the objects to be removed only for the player that types the command, and for them to be restored the same, only for the player who types the command. How can I do that?
Reply
#2

Post a screenshot of the map/problem or w/e you are trying to achieve.

Reading your recent threads, it's hard to tell.
Reply
#3

Removing building for a specific player aint possible until SAMP team add a virual world argument.
Reply
#4

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
Removing building for a specific player aint possible until SAMP team add a virual world argument.
What? Then why is there a playerid parameter?
Reply
#5

Quote:
Originally Posted by Vince
Посмотреть сообщение
What? Then why is there a playerid parameter?
He wants to restore building as well, so he is using this : https://sampforum.blast.hk/showthread.php?pid=1551937#pid1551937

I dont see any way that he can remove building and restore it using above inc, unless and until one decide to make even more arrays for storing buildings per player.
Reply
#6

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
Post a screenshot of the map/problem or w/e you are trying to achieve.

Reading your recent threads, it's hard to tell.
I've mapped an interior literally inside a building. When I enter, the building's collision takes me out of the mapping, therefore I have to remove the building when I enter and restore it when I exit. The problem is that when I enter the building dissapears for everybody, same happens for /exit - it reappers for everybody, even for those inside the building (the collision comes back and forces everyone inside OUT ). I want to make it so only the person that /enters the building removes the building's collision, not for everyone.
Here are pictures:

Reply
#7

So is it possible or not?
Reply
#8

Yes, very possible, just not with the include you're using, you must use the native RemoveBuildingForPlayer.
Example ZCMD commands based on your code (I strongly advise you to switch to zcmd because it's faster and easier):

pawn Код:
new RemoveObjectVar2;

COMMAND:enter(playerid, params[])
{
    if (IsPlayerInRangeOfPoint(playerid, 1.0, 172.66, -152.10, 1.72)) // checks if in range of the /enter point
    {
        RemoveBuildingForPlayer(playerid, 12923, 158.3594, -176.3047, 5.5703, 0.25);
        SetPlayerPos(playerid, 170.75, -153.94, 1.81); // Sets their new position
    }
    return 1;
}
COMMAND:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 1.0, 170.85, -153.85, 1.48)) // Checks if near the exit door
    {
        RemoveObjectVar2 = CreateObject(12923, 158.3594, -176.3047, 5.5703);
        SetPlayerPos(playerid, 172.24, -152.26, 1.81);
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
Yes, very possible, just not with the include you're using, you must use the native RemoveBuildingForPlayer.
Example ZCMD commands based on your code (I strongly advise you to switch to zcmd because it's faster and easier):

pawn Код:
new RemoveObjectVar2;

COMMAND:enter(playerid, params[])
{
    if (IsPlayerInRangeOfPoint(playerid, 1.0, 172.66, -152.10, 1.72)) // checks if in range of the /enter point
    {
        RemoveBuildingForPlayer(playerid, 12923, 158.3594, -176.3047, 5.5703, 0.25);
        SetPlayerPos(playerid, 170.75, -153.94, 1.81); // Sets their new position
    }
    return 1;
}
COMMAND:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 1.0, 170.85, -153.85, 1.48)) // Checks if near the exit door
    {
        RemoveObjectVar2 = CreateObject(12923, 158.3594, -176.3047, 5.5703);
        SetPlayerPos(playerid, 172.24, -152.26, 1.81);
    }
    return 1;
}
Код:
E:\SA-MP Server\pawno\include\zcmd.inc(62) : warning 235: public function lacks forward declaration (symbol "OnGameModeInit")
E:\SA-MP Server\pawno\include\zcmd.inc(64) : error 017: undefined symbol "funcidx"
E:\SA-MP Server\pawno\include\zcmd.inc(64) : warning 215: expression has no effect
E:\SA-MP Server\pawno\include\zcmd.inc(64) : error 001: expected token: ";", but found ")"
E:\SA-MP Server\pawno\include\zcmd.inc(64) : error 029: invalid expression, assumed zero
E:\SA-MP Server\pawno\include\zcmd.inc(64) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#10

For one thing I know of, that error would only happen if you didn't include a_samp before zcmd. So make sure you did!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)