SA-MP Forums Archive
NEED HELP NOW !!! About a cmd ... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NEED HELP NOW !!! About a cmd ... (/showthread.php?tid=233731)



NEED HELP NOW !!! About a cmd ... - Michael@Belgium - 02.03.2011

SOLVED!



Re: NEED HELP NOW !!! About a cmd ... - Dudits - 02.03.2011

Make sure you are using the gamemode/filterscript that you're compiling.


Re: NEED HELP NOW !!! About a cmd ... - Michael@Belgium - 02.03.2011

Quote:
Originally Posted by Dudits
Посмотреть сообщение
Make sure you are using the gamemode/filterscript that you're compiling.
? i don't understand xD ... it's just a gamemode command ...


Re: NEED HELP NOW !!! About a cmd ... - pantelimonfl - 02.03.2011

Try this. Not tested
pawn Код:
if(strcmp(cmdtext, "/firemencmds", true) == 0)
    {
        if(gTeam[playerid] == FIREMEN)
        {
            SendClientMessage(playerid, COLOR_WHITE, "------------------------------FIREMAN COMMANDS------------------");
            SendClientMessage(playerid, COLOR_ORANGE, "[TRY THAT!] /fire ** /gowork ** [TEAMCHAT] /! <message>");
            SendClientMessage(playerid, COLOR_ORANGE, "[PRACTICE] /makefire <1/2/3/4/5>");
            SendClientMessage(playerid, COLOR_WHITE, "-----------------------------------------------------------------------");
            return 1;
        }

    }



Re: NEED HELP NOW !!! About a cmd ... - AK47317 - 02.03.2011

pawn Код:
if(strcmp(cmdtext, "/firemencmds", true) == 0)
        {
if(gTeam[playerid] == FIREMEN)
    {
            SendClientMessage(playerid, COLOR_WHITE, "------------------------------FIREMAN COMMANDS------------------");
            SendClientMessage(playerid, COLOR_ORANGE, "[TRY THAT!] /fire ** /gowork ** [TEAMCHAT] /! <message>");
            SendClientMessage(playerid, COLOR_ORANGE, "[PRACTICE] /makefire <1/2/3/4/5>");
            SendClientMessage(playerid, COLOR_WHITE, "-----------------------------------------------------------------------");
} else SendClientMessage(playerid, color..., "You're Not A Fireman!.");
            return 1;
        }



Re: NEED HELP NOW !!! About a cmd ... - Michael@Belgium - 02.03.2011

Quote:
Originally Posted by pantelimonfl
Посмотреть сообщение
Try this. Not tested
pawn Код:
if(strcmp(cmdtext, "/firemencmds", true) == 0)
    {
        if(gTeam[playerid] == FIREMEN)
        {
            SendClientMessage(playerid, COLOR_WHITE, "------------------------------FIREMAN COMMANDS------------------");
            SendClientMessage(playerid, COLOR_ORANGE, "[TRY THAT!] /fire ** /gowork ** [TEAMCHAT] /! <message>");
            SendClientMessage(playerid, COLOR_ORANGE, "[PRACTICE] /makefire <1/2/3/4/5>");
            SendClientMessage(playerid, COLOR_WHITE, "-----------------------------------------------------------------------");
            return 1;
        }

    }
Quote:
Originally Posted by AK47317
Посмотреть сообщение
pawn Код:
if(strcmp(cmdtext, "/firemencmds", true) == 0)
        {
if(gTeam[playerid] == FIREMEN)
    {
            SendClientMessage(playerid, COLOR_WHITE, "------------------------------FIREMAN COMMANDS------------------");
            SendClientMessage(playerid, COLOR_ORANGE, "[TRY THAT!] /fire ** /gowork ** [TEAMCHAT] /! <message>");
            SendClientMessage(playerid, COLOR_ORANGE, "[PRACTICE] /makefire <1/2/3/4/5>");
            SendClientMessage(playerid, COLOR_WHITE, "-----------------------------------------------------------------------");
} else SendClientMessage(playerid, color..., "You're Not A Fireman!.");
            return 1;
        }
OMG >_< i have tested all of your cmd, but still 'You are not a medic/admin'?


Re: NEED HELP NOW !!! About a cmd ... - AK47317 - 02.03.2011

sorry for 2 post..

lol when i type there's no post b4 it so then... LOL


Re: NEED HELP NOW !!! About a cmd ... - Michael@Belgium - 02.03.2011

Quote:
Originally Posted by AK47317
Посмотреть сообщение
sorry for 2 post..

lol when i type there's no post b4 it so then... LOL
Ok ??!!


Re: NEED HELP NOW !!! About a cmd ... - Infamous - 02.03.2011

Search for the message your recieving within your script and make sure the if statement is returning the message correcty and not just sending it.


Re: NEED HELP NOW !!! About a cmd ... - Michael@Belgium - 02.03.2011

Quote:
Originally Posted by Infamous
Посмотреть сообщение
Search for the message your recieving within your script and make sure the if statement is returning the message correcty and not just sending it.
Aah, here is the recieving message used ... but it's correct ?! or not ..

pawn Код:
if(strcmp("/healplayer", cmd, true) == 0)
        {
            if (gTeam[playerid] == MEDIC || gTeam[playerid] == ADMIN)
            {
                tmp = strtok(cmdtext,idx);
                if(!strlen(tmp))
                {
                    return SendClientMessage(playerid,COLOR_GREEN,"USAGE: /heal [id]");
                }
                new id = strval(tmp);
                new pid = playerid;
                if(!IsPlayerConnected(id))
                {
                    return SendClientMessage(playerid,COLOR_BROWN,"This player is not online!");
                }
                new Float:X,Float:Y,Float:Z, string[128], name[MAX_PLAYER_NAME];
                GetPlayerName(id,name,128);
                GetPlayerPos(id,X,Y,Z);
                if(IsPlayerInRangeOfPoint(playerid,3,X,Y,Z))
                {
                    format(string,128,"[INFO] Medic/Admin %s[%d] has healed you!", name, pid);
                                    SetPlayerHealth(id,100);
                    SendClientMessage(id,COLOR_YELLOWORANGE,string);
                    SendClientMessage(playerid, COLOR_GREEN, " You have succesfully healed the player !");
                    DisablePlayerCheckpoint(playerid);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid,COLOR_RED,"You're not near the player!");
                }
            }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"You're not a Medic/Admin!");//here !

            }
            return 1;
        }