SA-MP Forums Archive
Warning - 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: Warning (/showthread.php?tid=611187)



Warning - Eymeric69 - 03.07.2016

Hi everybody i have warning i don't very understand here is the code with the warning

PHP код:
C:\Users\4neals\Desktop\Scripting\Test\gamemodes\UGRP.pwn(7440) : warning 213tag mismatch
C
:\Users\4neals\Desktop\Scripting\Test\gamemodes\UGRP.pwn(7440) : warning 202number of arguments does not match definition
C
:\Users\4neals\Desktop\Scripting\Test\gamemodes\UGRP.pwn(21431) : warning 219local variable "PlayerName" shadows a variable at a preceding level
new jailTimer[MAX_PLAYERS];
new 
jailed[MAX_PLAYERS];
CMD:jail(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin])
    {
        new 
string[128], cibleidtimereason[128], PlayerName[MAX_PLAYER_NAME], APlayerName[MAX_PLAYER_NAME];
        if(
sscanf(params,"dds",cibleid,time,reason)) return SendClientMessage(playerid, -1"USAGE: /jail [playerid] [time] [reason]");
        if (!
IsPlayerConnected(cibleid)) return SendClientMessage(playerid, -1"[ERROR]The Player is not connected.");
        if(
jailed[cibleid] == 1) return SendClientMessage(playerid, -1"[ERROR]The Player is already jailed.");
        
GetPlayerName(cibleidPlayerNamesizeof(PlayerName));
        
GetPlayerName(playeridAPlayerNamesizeof(APlayerName));
        
format(stringsizeof(string), "%s has been jailed for %d minutes; Reason: %s"PlayerNametimereason);
        
SendClientMessageToAll(-1string);
        
SetPlayerHealth(cibleid9999999999.0);
        
ResetPlayerWeapons(cibleid);
    }
    return 
1;
}
CMD:release(playerid,params[])
{
    if(
PlayerInfo[playerid][pAdmin])
    {
        new 
cibleid;
        if(
sscanf(params,"u",cibleid)) return SendClientMessage(playerid, -1"USAGE: /unjail [playerid]");
        if (!
IsPlayerConnected(cibleid)) return SendClientMessage(playerid, -1"[ERROR]The Player is not connected.");
        if(
jailed[cibleid] == 0) return SendClientMessage(playerid, -1"[ERROR]The Player is not jailed.");
        {
            
jailed[cibleid] = 0;
        }
        
SpawnPlayer(cibleid);
        
SetPlayerHealth(cibleid100);
        
KillTimer(jailTimer[cibleid]);
    }
    return 
1;

thanks if you help


Re: Warning - M26 - 03.07.2016

Show your warning line pls


Re: Warning - Mencent - 03.07.2016

Hello!

PHP код:
CMD:jail(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin])
    {
        new 
string[128], cibleidtimereason[128], PlayerName1[MAX_PLAYER_NAME], APlayerName[MAX_PLAYER_NAME];
        if(
sscanf(params,"dds",cibleid,time,reason)) return SendClientMessage(playerid, -1"USAGE: /jail [playerid] [time] [reason]");
        if (!
IsPlayerConnected(cibleid)) return SendClientMessage(playerid, -1"[ERROR]The Player is not connected.");
        if(
jailed[cibleid] == 1) return SendClientMessage(playerid, -1"[ERROR]The Player is already jailed.");
        
GetPlayerName(cibleidPlayerName1sizeof(PlayerName1));
        
GetPlayerName(playeridAPlayerNamesizeof(APlayerName));
        
format(stringsizeof(string), "%s has been jailed for %d minutes; Reason: %s"PlayerName1timereason);
        
SendClientMessageToAll(-1string);
        
SetPlayerHealth(cibleid9999999999.0);
        
ResetPlayerWeapons(cibleid);
    }
    return 
1;

So. Where are the other two (row 7440) mistakes?


Re: Warning - Eymeric69 - 03.07.2016

Quote:
Originally Posted by M26
Посмотреть сообщение
Show your warning line pls
the warning lines is in the top of the script when i have send you but here it is :
Код:
C:\Users\4neals\Desktop\Scripting\Test\gamemodes\UGRP.pwn(7440) : warning 213: tag mismatch 
C:\Users\4neals\Desktop\Scripting\Test\gamemodes\UGRP.pwn(7440) : warning 202: number of arguments does not match definition 
C:\Users\4neals\Desktop\Scripting\Test\gamemodes\UGRP.pwn(21431) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

PHP код:
CMD:jail(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin])
    {
        new 
string[128], cibleidtimereason[128], PlayerName1[MAX_PLAYER_NAME], APlayerName[MAX_PLAYER_NAME];
        if(
sscanf(params,"dds",cibleid,time,reason)) return SendClientMessage(playerid, -1"USAGE: /jail [playerid] [time] [reason]");
        if (!
IsPlayerConnected(cibleid)) return SendClientMessage(playerid, -1"[ERROR]The Player is not connected.");
        if(
jailed[cibleid] == 1) return SendClientMessage(playerid, -1"[ERROR]The Player is already jailed.");
        
GetPlayerName(cibleidPlayerName1sizeof(PlayerName1));
        
GetPlayerName(playeridAPlayerNamesizeof(APlayerName));
        
format(stringsizeof(string), "%s has been jailed for %d minutes; Reason: %s"PlayerName1timereason);
        
SendClientMessageToAll(-1string);
        
SetPlayerHealth(cibleid9999999999.0);
        
ResetPlayerWeapons(cibleid);
    }
    return 
1;

So. Where are the other two (row 7440) mistakes?
this :
PHP код:
new jailTimer[MAX_PLAYERS]; 
new 
jailed[MAX_PLAYERS]; 



Re: Warning - Mencent - 03.07.2016

Show us the code of the both variables.


Re: Warning - Eymeric69 - 03.07.2016

PHP код:
new jailTimer[MAX_PLAYERS]; 
new 
jailed[MAX_PLAYERS]; 



Re: Warning - Mencent - 03.07.2016

There is not a mistake. Show us more code.


Re: Warning - Shinja - 03.07.2016

What are the error lines?