HELP! Fast
#1

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext, "/advcmds", true) == 0)
    {
        SendClientMessage(playerid, COLOR_GREEN, "Advanced Commands Help!");
        SendClientMessage(playerid, COLOR_GREEN, "/kickme - Kicks Player Who Entered Command");
        SendClientMessage(playerid, COLOR_GREEN, "/killme - Kills Player Who Entered Command");
        SendClientMessage(playerid, COLOR_GREEN, "/banme  - Bans  Player Who Entered Command");
        SendClientMessage(playerid, COLOR_GREEN, "/repair - Repair Player's Vehicle Who Entered Command");
        //This command will show the commands in this filterscript to the player who entered this command
    }
        return 1;
    }
    if(strcmp(cmdtext, "/kickme", true) == 0)
    {
        //This command will kick the player who enters this command
        Kick(playerid);
        return 1;
    }
    if(strcmp("/killme", cmdtext, true))
    {
        //This command will kill the player who enters this command
        SetPlayerHealth(playerid, 0.0);
        return 1;
    }
    if(strcmp("/banme", cmdtext, true))
    {
        //This command will ban the player who enters this command
        Ban(playerid);
        return 1;
    }
    if (!strcmp("/repair", cmdtext))
    {
        //This command will repair the player's vehicle whoever has entered it
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not currently in a vehicle!");
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
        return 1;
    }
    return 0;
I know that it has to do with the brackets but where?
Reply
#2

pawn Код:
//----------------------------------------
// Project Commands Advanced
// Credits
// - DJTunes
// Information
// - 4th of 5th Filterscript
// - Going Deeper into the FS scripting game
//----------------------------------------
// Defines =
#define FILTERSCRIPT

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_SEAGREEN 0x20B2AAAA
#define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA // - Light light pink
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
//----------------------------------------
// Includes =
#include <a_samp>
//----------------------------------------
public OnFilterScriptInit()
{
 print("\n--------------------------------------");
 print(" Advanced Commands Loading....... Load Complete!");
 print("--------------------------------------\n");
 return 1;
}
//----------------------------------------
public OnFilterScriptExit()
{
 print("\n--------------------------------------");
 print(" Advanced Commands Un-Loading....... Un-Load Complete!");
 print("--------------------------------------\n");
 return 1;
}

// This section is what makes this filterscript work! :)

public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/advcmds", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, COLOR_GREEN, "Advanced Commands Help!");
        SendClientMessage(playerid, COLOR_GREEN, "/kickme - Kicks Player Who Entered Command");
        SendClientMessage(playerid, COLOR_GREEN, "/killme - Kills Player Who Entered Command");
        SendClientMessage(playerid, COLOR_GREEN, "/banme  - Bans  Player Who Entered Command");
        SendClientMessage(playerid, COLOR_GREEN, "/repair - Repair Player's Vehicle Who Entered Command");
    }
    if (strcmp("/kickme", cmdtext, true, 10) == 0)
    {
        //This command will kick the player who enters this command
        Kick(playerid);
        return 1;
    }
    if (strcmp("/killme", cmdtext, true, 10) == 0)
    {
        //This command will kill the player who enters this command
        SetPlayerHealth(playerid, 0);
        return 1;
    }
    if (strcmp("/banme", cmdtext, true, 10) == 0)
    {
        //This command will ban the player who enters this command
        Ban(playerid);
        return 1;
    }
    if (strcmp("/repair", cmdtext, true, 10) == 0)
    {
        //This command will repair the player's vehicle whoever has entered it
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not currently in a vehicle!");
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
        return 1;
    }
    return 0;
}
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/advcmds", true) == 0)
    {
        SendClientMessage(playerid, COLOR_GREEN, "Advanced Commands Help!");
        SendClientMessage(playerid, COLOR_GREEN, "/kickme - Kicks Player Who Entered Command");
        SendClientMessage(playerid, COLOR_GREEN, "/killme - Kills Player Who Entered Command");
        SendClientMessage(playerid, COLOR_GREEN, "/banme  - Bans  Player Who Entered Command");
        SendClientMessage(playerid, COLOR_GREEN, "/repair - Repair Player's Vehicle Who Entered Command");
        //This command will show the commands in this filterscript to the player who entered this command
        return 1;
    }
    if(strcmp(cmdtext, "/kickme", true) == 0)
    {
        //This command will kick the player who enters this command
        Kick(playerid);
        return 1;
    }
    if(strcmp("/killme", cmdtext, true))
    {
        //This command will kill the player who enters this command
        SetPlayerHealth(playerid, 0.0);
        return 1;
    }
    if(strcmp("/banme", cmdtext, true))
    {
        //This command will ban the player who enters this command
        Ban(playerid);
        return 1;
    }
    if (!strcmp("/repair", cmdtext))
    {
        //This command will repair the player's vehicle whoever has entered it
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not currently in a vehicle!");
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)