Please Help me :'(
#1

pawn Код:
C:\Users\carlo\Desktop\SA-MP Server\RolePlay\gamemodes\SATDM_v11.pwn(39832) : warning 235: public function lacks forward declaration (symbol "DisableGod")
pawn Код:
public DisableGod(playerid)
{
    SetPlayerHealth(playerid, 100.000);
    SendClientMessage(playerid, COLOR_RED,"Your Spawn Kill Protection Is End");
    return 1;
}
Fvckin Warning Pawncc Gave To me
Its Annoying

pawn Код:
C:\Users\carlo\Desktop\SA-MP Server\RolePlay\gamemodes\SATDM_v11.pwn(17251) : warning 219: local variable "info" shadows a variable at a preceding level
pawn Код:
if(pickupid == info)
    {
    new info[2500];
    strcat(info, "{FF0000}______________________________________________{33AA33}|- BEGINNER GUIDE -|{FF0000}______________________________________________  \n", sizeof(info));
    strcat(info, "{33AA33}|- {FF0000}House System {33AA33}-|\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}You Can Find Houses All Over San Andreas Map. Houses Come Variety Of Different Styles,Sizes ,And Prices\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}Server Has Professional Mapper So They Can Create\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/buyh Is To Buy Available House. And /sellh Is TO Sell Your Current House \n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/lockh Is To Lock Your House. And /unlockh is To Unlock Your House \n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/enterh To Enter a Houses. And /exith To Exit To The House {FF0000}[NOTE: Dont Use Doors]\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/gotoh To Teleport To Your House\n", sizeof(info));
    strcat(info, "{33AA33}|- {FF0000}Vehicle Ownership System {33AA33}-|\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}You Can Find Vehicles All Over San Andereas Map. There are 2000 Vehicles Can Buy, 180 Models ,and 15 Max Vehicles \n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}We Have Many Command For Vehicle Ownership System \n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/vbuy To Buy Vehicles. ,and /vsell To Sell Your Vehicles \n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/vcall To call Your Vehicle One By One. and /vpark to Park Your Vehicle \n", sizeof(info));
    strcat(info, "{33AA33}|- {FF0000}Business System {33AA33}-|\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}Your Bussines Will Earn Specific Ammount Of Money per Hour And That Ammount differs From bussines To Bussines\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/buybiz To Buy A Business, /sellbiz To Sell Your Current Business\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/gotobiz To Teleport To Your Business, /cashbox And Your Money Will be sent to your Bank Account \n", sizeof(info));
    strcat(info, "{33AA33}|- {FF0000}Other {33AA33}-|\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/racehelp To See Race Commands\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/bankhelp(l) To See Laws Commands\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/medichelp(l) To See Medics Commands\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/cellhelp(l) To See Cellphone Commands\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/ganghelp(l) To See Gangs Commands\n", sizeof(info));
    strcat(info, "{FFFF00}- {FFFFFF}/telehelp(l) To See Teleports Commands\n", sizeof(info));
    strcat(info, "{FF0000}__________________________________________________________________________________  \n", sizeof(info));
    ShowPlayerDialog(playerid, 174, DIALOG_STYLE_MSGBOX, "NEW-GENERATION HELP", info, "Close","");
    return 1;
    }
pawn Код:
CMD:tune(playerid, params[])
{
    if(isnull(params))
    {
        SendClientMessage(playerid, red, " Usage: /tune [1-4] ");
        SendClientMessage(playerid, red, " FUNCTION: To Teleport To The Tune Garages ");
        return 1;
    }
    else
    {
        switch(strval(params))
        {
            case 1:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), -1935.985, 231.728, 34.1546);
                }
                else
                {
                    SetPlayerPos(playerid, -1935.985, 231.728, 34.1546);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 1", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);

                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 1", 3000, 4);
                return 1;
            }
            case 2:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), -2709.731, 217.423, 4.179);
                }
                else
                {
                    SetPlayerPos(playerid, -2709.731, 217.423, 4.179);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                format(string, sizeof(string), "%s has just teleported to Tune 2 /Tune 2", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);

                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 2", 3000, 4);
                return 1;
            }
            case 3:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), 2386.802, 1036.320, 10.280);
                }
                else
                {
                    SetPlayerPos(playerid, 2386.802, 1036.320, 10.280);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 3", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);

                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 3", 3000, 4);
                return 1;
            }
            case 4:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), 2644.976, -2030.903, 13.554);
                }
                else
                {
                    SetPlayerPos(playerid, 2644.976, -2030.903, 13.554);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 4", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);

                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 4", 3000, 4);
                return 1;
            }
        }
    }
    return 1;
}
Bugs:
It Show This
" Has Been teleported at tune 1"

Who Can Solve This REP++++
Reply
#2

in the first 1 , you should forward the function
pawn Код:
forward Disablegod(playerid)
idk what the problem with 2 but check the dialog name &id and make sure that its info
and the third 1 i suggess to you to use sscanf.
Reply
#3

Same Error That You Gave To me That Forward

What Third?
Reply
#4

if(pickupid == info)
{
new info[2500];

Two variables with the same name, one is shadowing the other. Rename the second one.

At "bugs": You have initialized the variable but dont do anything with it. You still need to fetch the name.
Reply
#5

To fix the 1є error, put this on the top of the Gamemode/FS or before the Public:

pawn Код:
forward DisableGod(playerid);
To fix the 2є error:

Rename the "info" string that you use in the dialog the pickup name and the string have the same name, that's what's causing the error...

To fix the cmd error:

You need to use the function GetPlayerName. (I already inserted the function into your cmd)

pawn Код:
CMD:tune(playerid, params[])
{
    if(isnull(params))
    {
        SendClientMessage(playerid, red, " Usage: /tune [1-4] ");
        SendClientMessage(playerid, red, " FUNCTION: To Teleport To The Tune Garages ");
        return 1;
    }
    else
    {
        switch(strval(params))
        {
            case 1:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), -1935.985, 231.728, 34.1546);
                }
                else
                {
                    SetPlayerPos(playerid, -1935.985, 231.728, 34.1546);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 1", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 1", 3000, 4);
                return 1;
            }
            case 2:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), -2709.731, 217.423, 4.179);
                }
                else
                {
                    SetPlayerPos(playerid, -2709.731, 217.423, 4.179);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 2 /Tune 2", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 2", 3000, 4);
                return 1;
            }
            case 3:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), 2386.802, 1036.320, 10.280);
                }
                else
                {
                    SetPlayerPos(playerid, 2386.802, 1036.320, 10.280);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 3", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 3", 3000, 4);
                return 1;
            }
            case 4:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), 2644.976, -2030.903, 13.554);
                }
                else
                {
                    SetPlayerPos(playerid, 2644.976, -2030.903, 13.554);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 4", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 4", 3000, 4);
                return 1;
            }
        }
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Douglas_prt
Посмотреть сообщение
To fix the 1є error, put this on the top of the Gamemode/FS or before the Public:

pawn Код:
forward DisableGod;
To fix the 2є error:

Rename the "info" string that you use in the dialog the pickup name and the string have the same name, that's what's causing the error...

To fix the cmd error:

You need to use the function GetPlayerName. (I already inserted the function into your cmd)

pawn Код:
CMD:tune(playerid, params[])
{
    if(isnull(params))
    {
        SendClientMessage(playerid, red, " Usage: /tune [1-4] ");
        SendClientMessage(playerid, red, " FUNCTION: To Teleport To The Tune Garages ");
        return 1;
    }
    else
    {
        switch(strval(params))
        {
            case 1:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), -1935.985, 231.728, 34.1546);
                }
                else
                {
                    SetPlayerPos(playerid, -1935.985, 231.728, 34.1546);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 1", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 1", 3000, 4);
                return 1;
            }
            case 2:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), -2709.731, 217.423, 4.179);
                }
                else
                {
                    SetPlayerPos(playerid, -2709.731, 217.423, 4.179);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 2 /Tune 2", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 2", 3000, 4);
                return 1;
            }
            case 3:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), 2386.802, 1036.320, 10.280);
                }
                else
                {
                    SetPlayerPos(playerid, 2386.802, 1036.320, 10.280);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 3", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 3", 3000, 4);
                return 1;
            }
            case 4:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), 2644.976, -2030.903, 13.554);
                }
                else
                {
                    SetPlayerPos(playerid, 2644.976, -2030.903, 13.554);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 4", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 4", 3000, 4);
                return 1;
            }
        }
    }
    return 1;
}
rep++
Reply
#7

Quote:
Originally Posted by Douglas_prt
Посмотреть сообщение
To fix the 1є error, put this on the top of the Gamemode/FS or before the Public:

pawn Код:
forward DisableGod;
To fix the 2є error:

Rename the "info" string that you use in the dialog the pickup name and the string have the same name, that's what's causing the error...

To fix the cmd error:

You need to use the function GetPlayerName. (I already inserted the function into your cmd)

pawn Код:
CMD:tune(playerid, params[])
{
    if(isnull(params))
    {
        SendClientMessage(playerid, red, " Usage: /tune [1-4] ");
        SendClientMessage(playerid, red, " FUNCTION: To Teleport To The Tune Garages ");
        return 1;
    }
    else
    {
        switch(strval(params))
        {
            case 1:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), -1935.985, 231.728, 34.1546);
                }
                else
                {
                    SetPlayerPos(playerid, -1935.985, 231.728, 34.1546);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 1", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 1", 3000, 4);
                return 1;
            }
            case 2:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), -2709.731, 217.423, 4.179);
                }
                else
                {
                    SetPlayerPos(playerid, -2709.731, 217.423, 4.179);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 2 /Tune 2", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 2", 3000, 4);
                return 1;
            }
            case 3:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), 2386.802, 1036.320, 10.280);
                }
                else
                {
                    SetPlayerPos(playerid, 2386.802, 1036.320, 10.280);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 3", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 3", 3000, 4);
                return 1;
            }
            case 4:
            {
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), 2644.976, -2030.903, 13.554);
                }
                else
                {
                    SetPlayerPos(playerid, 2644.976, -2030.903, 13.554);
                }

                new dsname[MAX_PLAYER_NAME];
                new string[182];
                GetPlayerName(playerid, dsname, sizeof(dsname));
                format(string, sizeof(string), "%s has just teleported to Tune 1 /Tune 4", dsname);
                SendClientMessageToAll(COLOR_YELLOW, string);
                GameTextForPlayer(playerid, "~B~Welcome To ~r~Tune 4", 3000, 4);
                return 1;
            }
        }
    }
    return 1;
}
That forward would not work. It has to be the same as the public.
Reply
#8

Yes IKnow Please can You Teach Me Scripting??
Pm me If You Want
Reply
#9

He edited his post to the correct one
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)