SA-MP Forums Archive
Little problems! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Little problems! (/showthread.php?tid=374691)



Little problems! - T_Boy - 03.09.2012

Hello! I am back with two new problems.
1. When I type /enter to enter the Hitman HQ it works fine, but I also receive: SERVER : Unknown command! Same with the /exit command!

2. My factions are in a filterscript folder and my commands are in the gamemode file. I want to make a command which gives hitman agency members health and weapons, but I can't make it just for them, because my factions are not in that gamemode...

Hope you can help me with these problems!
Thank you and sorry for my bad english!


Re: Little problems! - ikkentim - 03.09.2012

1. You have to "return 1;" at the end of your /enter command.

2. Make the functions you want to call in your filterscripts public, use https://sampwiki.blast.hk/wiki/CallRemoteFunction in your game mode to call it.


Re: Little problems! - [BOPE]Seu._.Madruga - 03.09.2012

Bom vou te dar um exemplo
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmd,"/entrar", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 1481.0358,-1771.8085,18.7958))/*-- entrar prefeitura --*/
        {
            SetPlayerInterior(playerid,3);
            SetPlayerPos(playerid,390.3704,173.8128,1008.3828);
            return 1;
        }
        return 1;
    }
    return SendClientMessage(playerid,0xFFFFFFFF,"[x] Comando Invalido.");
}
Se ajudei da reputation


Re: Little problems! - T_Boy - 04.09.2012

@ikkentim: 1 worked, but I don't know how to use CallRemoteFunction, and SA:MP Wiki doesn't help me...


Re: Little problems! - T_Boy - 04.09.2012

My command looks like this:
if(!strcmp(cmdtext, "/wh", true))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2175.5471,1619.1520,999.9766))
{
if (PlayerOrg[playerid] == 8 )
{
SetPlayerHealth(playerid,100);
GivePlayerWeapon(playerid,4,5);
GivePlayerWeapon(playerid,23,3500);
GivePlayerWeapon(playerid,29,3500);
GivePlayerWeapon(playerid,31,3500);
GivePlayerWeapon(playerid,34,100);
}
}
}

The problem is that I don't have PlayerOrg in the gamemode file, because it is in the filterscript file! So, please help me!


Re: Little problems! - shamortiy - 04.09.2012

So dont make filterscript's but put all the crap in gamemode :P


Re: Little problems! - T_Boy - 04.09.2012

Another method?


Re: Little problems! - ikkentim - 05.09.2012

(he asked me to reply, in pm)
In your gamemode
forward doSomethungWith(playerid);
public doSomethingWith(playerid)
{
//whatever you want to do
}

in your filterscript
CallRemoteFunction("doSomethingWith", "d", playerid);


///
In that function in your gamemode you change the variables you want to change, amd by using callRemoteFunction you can call that function


Re: Little problems! - T_Boy - 06.09.2012

Thank you! Repped +!