Warning
#1

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
Reply
#2

Show your warning line pls
Reply
#3

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?
Reply
#4

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]; 
Reply
#5

Show us the code of the both variables.
Reply
#6

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

There is not a mistake. Show us more code.
Reply
#8

What are the error lines?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)