Got a Warning for scripting
#1

Код:
CMD:kick(playerid, params[])
{
        new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
	new id, reason[126];
	if (sscanf(params, "us[126]", id, reason))
	    return SendClientMessage (playerid, -1, "Usage: /kick [ID] [text]");
 	GetPlayerName(playerid, name, sizeof(name));
 	format(string, sizeof(string), "%s(%d) has been Kick by %s(%d). Reason: %s .", name, id, reason);
	Kick(id);
}
Warning,
Код:
E:\Castaway Island Roleplay Server\Castaway Island Roleplay Server Files\gamemodes\CI-RP.pwn(599) : warning 209: function "cmd_kick" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Can anyone help me with this ? Using ZCMD and sscanf2
Reply
#2

Nevermind solved ... I just forgot to add return 1; .
Reply
#3

pawn Код:
CMD:kick(playerid, params[])
{
    new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
    new id, reason[126];
    if (sscanf(params, "us[126]", id, reason))
        return SendClientMessage (playerid, -1, "Usage: /kick [ID] [text]");
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s(%d) has been Kick by %s(%d). Reason: %s .", name, id, reason);
    Kick(id);
    return 1; //You forgot to return 1 after the command has finished
}
Reply
#4

Thanks , but I solved it myself . BTW , thanks.
Reply
#5

You also need to display what you formatted, in case you haven't noticed.

pawn Код:
SendClientMessageToAll(COLOR_RED, string);
For example.
Reply
#6

Quote:
Originally Posted by Abreezy
Посмотреть сообщение
You also need to display what you formatted, in case you haven't noticed.

pawn Код:
SendClientMessageToAll(COLOR_RED, string);
For example.
abereezy madafaka bitch go on msn u smd

but hes right.. u forgot SendclientMessageToAll
Reply
#7

Quote:
Originally Posted by mastermax7777
Посмотреть сообщение
abereezy madafaka bitch go on msn u smd

but hes right.. u forgot SendclientMessageToAll
Who be you o_o
Reply
#8

Oppsss..... I am careless
But Thanks guys ....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)