small help
#1

Код:
D:\My server\gamemodes\LvG_Script.pwn(1437) : warning 217: loose indentation
D:\My server\gamemodes\LvG_Script.pwn(1936) : warning 202: number of arguments does not match definition
D:\My server\gamemodes\LvG_Script.pwn(1936) : warning 202: number of arguments does not match definition
D:\My server\gamemodes\LvG_Script.pwn(1938) : warning 202: number of arguments does not match definition
D:\My server\gamemodes\LvG_Script.pwn(1938) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


Reply
#2

For 1437, you just simply need to properly indent the code.

For the rest you are not using GetPlayerName correctly. This is the correct way to use it:
pawn Код:
public OnPlayerConnect(playerid)
{
    // Get the name of the player that connected and display a join message to other players
 
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
 
    format(string, sizeof(string), "%s has joined the server.", name);
    SendClientMessageToAll(0xC4C4C4FF, string);
 
    return 1;
}
Source: https://sampwiki.blast.hk/wiki/GetPlayerName
Reply
#3

1936 & 1938:

Код:
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
Reply
#4

About 1437 it won't get fixed.
Reply
#5

Quote:
Originally Posted by KamalBa
Посмотреть сообщение
About 1437 it won't get fixed.
Wtf does that mean? Are you too lazy to do it? Or do you just not know how? You said that like you refuse to try, you shouldn't be scripting if you're going to refuse to do your own work. That's why I linked you to a good wiki on indenting correctly.
Reply
#6

give me full code please ?
Cryder, I know but it won't solved all of the solved expect it
Reply
#7

Quote:
Originally Posted by KamalBa
Посмотреть сообщение
About 1437 it won't get fixed.
He has answered the question, maybe that's for the example.
Reply
#8

Quote:
Originally Posted by KamalBa
Посмотреть сообщение
give me full code please ?
No, we are not here to give you code. This is the help section. DIY type of shit.
Quote:
Originally Posted by KamalBa
Посмотреть сообщение
Cryder, I know but it won't solved all of the solved expect it
If you do it correctly, YES, it will solve all of the indentation warnings.
Reply
#9

Код:
CMD:pm(playerid, params[])
{
    new targetid,message[128],string[256];
    if(sscanf(params,"us[256]", targetid, message)) return SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /pm [playerid] [message]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,COLOR_RED,"Player is not online");
    if(targetid == playerid) return SendClientMessage(playerid,COLOR_RED,"You Can'nt PM Your Self!");
    if(AllowPM[targetid] == 1)
	{
        format(string, sizeof(string),"PM From %s Message: %s", GetPlayerName(playerid), message);
        SendClientMessage(targetid, COLOR_RED, string);
        format(string, sizeof(string),"PM send to %s Message: %s", GetPlayerName(targetid), message);
        SendClientMessage(playerid, COLOR_RED, string);
 }
    else return SendClientMessage(playerid, COLOR_RED,"That player is not allowing PM's to send to him, sorry!");
    return 1;
}
This command show me 4 warnings how to fix

Код:
D:\My server\gamemodes\LvG_Script.pwn(1983) : warning 202: number of arguments does not match definition
D:\My server\gamemodes\LvG_Script.pwn(1983) : warning 202: number of arguments does not match definition
D:\My server\gamemodes\LvG_Script.pwn(1985) : warning 202: number of arguments does not match definition
D:\My server\gamemodes\LvG_Script.pwn(1985) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Warnings.
Reply
#10

Quote:
Originally Posted by KamalBa
Посмотреть сообщение
Код:
CMD:pm(playerid, params[])
{
    new targetid,message[128],string[256];
    if(sscanf(params,"us[256]", targetid, message)) return SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /pm [playerid] [message]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,COLOR_RED,"Player is not online");
    if(targetid == playerid) return SendClientMessage(playerid,COLOR_RED,"You Can'nt PM Your Self!");
    if(AllowPM[targetid] == 1)
	{
        format(string, sizeof(string),"PM From %s Message: %s", GetPlayerName(playerid), message);
        SendClientMessage(targetid, COLOR_RED, string);
        format(string, sizeof(string),"PM send to %s Message: %s", GetPlayerName(targetid), message);
        SendClientMessage(playerid, COLOR_RED, string);
 }
    else return SendClientMessage(playerid, COLOR_RED,"That player is not allowing PM's to send to him, sorry!");
    return 1;
}
This command show me 4 warnings how to fix
Quote:
Originally Posted by justice96
Посмотреть сообщение
Код:
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
Quote:
Originally Posted by Crayder
Посмотреть сообщение
For the rest you are not using GetPlayerName correctly. This is the correct way to use it:
pawn Код:
public OnPlayerConnect(playerid)
{
    // Get the name of the player that connected and display a join message to other players
 
    new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
 
    format(string, sizeof(string), "%s has joined the server.", name);
    SendClientMessageToAll(0xC4C4C4FF, string);
 
    return 1;
}
Source: https://sampwiki.blast.hk/wiki/GetPlayerName
We have both already told you, even showed you how to fix that.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)