SA-MP Forums Archive
Help for errors and warnings -.- [+REP] - 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: Help for errors and warnings -.- [+REP] (/showthread.php?tid=378900)



Help for errors and warnings -.- [+REP] - pblbms - 19.09.2012

Код:
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(8970) : error 017: undefined symbol "ActiveEvent"
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(8977) : warning 213: tag mismatch
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(8977) : warning 213: tag mismatch
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(8977) : warning 213: tag mismatch
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(8979) : warning 204: symbol is assigned a value that is never used: "EventWorld"
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(8978) : warning 204: symbol is assigned a value that is never used: "EventInt"
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(9000) : error 017: undefined symbol "ActiveEvent"
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(9029) : error 017: undefined symbol "EventText"
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(9029) : error 017: undefined symbol "EventText"
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(9029) : error 029: invalid expression, assumed zero
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(9029) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Lines 8970 - 8979

Код:
              if(ActiveEvent == 0)
                {
					new EventX;
					new EventY;
					new EventZ;
					new EventInt;
					new EventWorld;
                    GetPlayerPos(playerid, EventX, EventY, EventZ);
                    EventInt = GetPlayerInterior(playerid);
                    EventWorld = GetPlayerVirtualWorld(playerid);
                    SendClientMessage(playerid, COLOR_WHITE, "You have sucessfully adjusted the event position.");
                }
Lines 9000 - 9029

Код:
             if(ActiveEvent == 0)
                {
                    tmp = strtok(cmdtext, idx);
                    if(!strlen(tmp))
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /seteventinfo [name]");
                        SendClientMessage(playerid, COLOR_GRAD1, "Available names: Jointext, Health, Armor, Gun1, Gun2, Gun3, Gun4, Gun5");
                        return 1;
                    }
                    if(strcmp(tmp,"jointext",true) == 0)
                    {
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[128];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /seteventinfo jointext [text]");
                            return 1;
                        }
                         format(EventText, sizeof(EventText), "%s", result);



Re: Help for errors and warnings -.- [+REP] - RLGaming - 19.09.2012

try adding:

new EventWorld[MAX_PLAYERS];
new ActiveEvent[MAX_PLAYERS];
new EventInt[MAX_PLAYERS];
new EventText[MAX_PLAYERS];

add the top of your GM

Not sure if it will work but it MIGHT fix some errors


Re: Help for errors and warnings -.- [+REP] - pblbms - 19.09.2012

Not this,not happend.


Re: Help for errors and warnings -.- [+REP] - pblbms - 19.09.2012

Help to fix this?


Re: Help for errors and warnings -.- [+REP] - pblbms - 20.09.2012

Please help?


Re: Help for errors and warnings -.- [+REP] - pblbms - 20.09.2012

Come on need me help to fix this errors and warnings -.-


Re: Help for errors and warnings -.- [+REP] - pblbms - 20.09.2012

I fix this errors and need me help to fix other..

Код:
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(8970) : error 017: undefined symbol "ActiveEvent"
D:\games\Скинове О.О\Без гангове\gamemodes\gangwars.pwn(9000) : error 017: undefined symbol "ActiveEvent"
I fix this errors.


Re: Help for errors and warnings -.- [+REP] - clarencecuzz - 20.09.2012

First of all:

pawn Код:
new Float:EventX;
                    new Float:EventY;
                    new Float:EventZ;
Why are you using all these variables? Do you have a /joinevent command or something related to that?


Re: Help for errors and warnings -.- [+REP] - pblbms - 20.09.2012

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
First of all:

pawn Код:
new Float:EventX;
                    new Float:EventY;
                    new Float:EventZ;
Why are you using all these variables? Do you have a /joinevent command or something related to that?
I fix 3 of my warnings with this,thanks!

Код:
D:\games\Скинове О.О\Без гангове\gamemodes\Save bugnat mod s event system\gangwars.pwn(8980) : warning 204: symbol is assigned a value that is never used: "EventWorld"
D:\games\Скинове О.О\Без гангове\gamemodes\Save bugnat mod s event system\gangwars.pwn(8979) : warning 204: symbol is assigned a value that is never used: "EventInt"
D:\games\Скинове О.О\Без гангове\gamemodes\Save bugnat mod s event system\gangwars.pwn(9030) : error 017: undefined symbol "EventText"
D:\games\Скинове О.О\Без гангове\gamemodes\Save bugnat mod s event system\gangwars.pwn(9030) : error 017: undefined symbol "EventText"
D:\games\Скинове О.О\Без гангове\gamemodes\Save bugnat mod s event system\gangwars.pwn(9030) : error 029: invalid expression, assumed zero
D:\games\Скинове О.О\Без гангове\gamemodes\Save bugnat mod s event system\gangwars.pwn(9030) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
This is the other warnings and errors.


Re: Help for errors and warnings -.- [+REP] - clarencecuzz - 20.09.2012

Here's a small script I have just made that should show you how you create a simple event system with strcmp. You can edit it however you like.

pawn Код:
#include <a_samp>

new InEvent[MAX_PLAYERS];
new EventRunning;
new Float:EventX, Float:EventY, Float:EventZ, Float:EventAng;
new EventInt, EventVW;

public OnGameModeInit() //Or OnFilterScriptInit if you're using a filterscript.
{
    EventRunning = 0;
    return 1;
}

public OnPlayerConnect(playerid)
{
    InEvent[playerid] = 0;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(InEvent[playerid] == 1)
    {
        SendClientMessage(playerid, 0xFF0000FF, "You Have Left The Event Because You Were Killed.");
        InEvent[playerid] = 0;
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/joinevent", true) == 0)
    {
        if(InEvent[playerid] == 1) return SendClientMessage(playerid, 0xFF0000FF, "You Are Already In The Event!");
        if(EventRunning == 0) return SendClientMessage(playerid, 0xFF0000FF, "There Is Currently No Events Running.");
        SetPlayerInterior(playerid, EventInt);
        SetPlayerPos(playerid, EventX, EventY, EventZ);
        SetPlayerFacingAngle(playerid, EventAng);
        SetPlayerVirtualWorld(playerid, EventVW);
        SendClientMessage(playerid, 0x00FF00FF, "You Have Joined The Event.");
        return 1;
    }

    if(strcmp(cmdtext, "/leaveevent", true) == 0)
    {
        if(InEvent[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You Are Not In An Event!");
        if(EventRunning == 0) return SendClientMessage(playerid, 0xFF0000FF, "There Is Currently No Events Running.");
        SpawnPlayer(playerid);
        InEvent[playerid] = 0;
        SendClientMessage(playerid, 0xFF0000FF, "You Have Left The Event.");
        return 1;
    }
    if(strcmp(cmdtext, "/beginevent", true) == 0)
    {
        if(EventRunning == 1) return SendClientMessage(playerid, 0xFF0000FF, "There Is Already An Event Happening.");
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "Only Administrators Can Start Events!");
        new Float:x, Float:y, Float:z;
        new Float:ang;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, ang);
        EventX = x;
        EventY = y;
        EventZ = z;
        EventAng = ang;
        EventRunning = 1;
        InEvent[playerid] = 1;
        new string[90];
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(string,sizeof(string),"Administrator %s Has Started An Event. Type /JOINEVENT To Join.",name);
        SendClientMessageToAll(0x00FF00FF, string);
        return 1;
    }
    if(strcmp(cmdtext, "/stopevent", true) == 0)
    {
        if(EventRunning == 0) return SendClientMessage(playerid, 0xFF0000FF, "There Is Currently No Events Running.");
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "Only Administrators Can End Events!");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(InEvent[i] == 1)
                {
                    SpawnPlayer(i);
                    InEvent[i] = 0;
                }
            }
        }
        EventRunning = 0;
        new string[60];
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(string,sizeof(string),"Administrator %s Has Ended The Event.",name);
        SendClientMessageToAll(0x00FF00FF, string);
        return 1;
    }
    return SendClientMessage(playerid, 0xFF0000FF, "This Command Does Not Exist.");
}