Little problems!
#1

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!
Reply
#2

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.
Reply
#3

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
Reply
#4

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

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!
Reply
#6

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

Another method?
Reply
#8

(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
Reply
#9

Thank you! Repped +!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)