Help [announce]
#1

Hello Guys.
Quote:

D:\try\gamemodes\textdraws.pwn(2047) : error 029: invalid expression, assumed zero
D:\try\gamemodes\textdraws.pwn(2047) : warning 215: expression has no effect
D:\try\gamemodes\textdraws.pwn(2047) : error 001: expected token: ";", but found "if"

this line 2047
Quote:

else if (sscanf(params, "iis[64]", style, time, text)) return SendClientMessage(playerid, -1, "Usage: /announce <style[0-6]> <time in ms> <text>");

PHP код:
CMD:announce(playeridparams[])
{
    new 
text[64], timestyle;
    if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8)
    else if (
sscanf(params"iis[64]"styletimetext)) return SendClientMessage(playerid, -1"Usage: /announce <style[0-6]> <time in ms> <text>");
    else if (
strlen(text) > 64) return SendClientMessage(playerid, -1"Message too long, please make it with less than 64 letters!");
    else if(
style == 2) return SendClientMessage(playerid, -1"Bug with style 2! Do not use it!");
    else if (
style || style 6) return SendClientMessage(playerid, -1,"Invalid style");
    else if (
time 20*1000) return SendClientMessage(playerid, -1"No longer than 20 seconds");
    else {
        
GameTextForAll(texttimestyle);
    }
    return 
1;

Reply
#2

PHP код:
CMD:announce(playeridparams[]) 

    new 
text[64], timestyle
    if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8) ; 
    else if (
sscanf(params"iis[64]"styletimetext)) return SendClientMessage(playerid, -1"Usage: /announce <style[0-6]> <time in ms> <text>"); 
    else if (
strlen(text) > 64) return SendClientMessage(playerid, -1"Message too long, please make it with less than 64 letters!"); 
    else if(
style == 2) return SendClientMessage(playerid, -1"Bug with style 2! Do not use it!"); 
    else if (
style || style 6) return SendClientMessage(playerid, -1,"Invalid style"); 
    else if (
time 20*1000) return SendClientMessage(playerid, -1"No longer than 20 seconds"); 
    else { 
        
GameTextForAll(texttimestyle); 
    } 
    return 
1

//you miss ";"
Reply
#3

see new error
Quote:

D:\ffff\gamemodes\textdraws.pwn(2031) : error 036: empty statement

PHP код:
if(PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8); 
Reply
#4

PHP код:
CMD:announce(playeridparams[])
{
    new 
text[64], timestyle;
    if (
sscanf(params"iis[64]"styletimetext)) return SendClientMessage(playerid, -1"Usage: /announce <style[0-6]> <time in ms> <text>");
    if (
strlen(text) > 64) return SendClientMessage(playerid, -1"Message too long, please make it with less than 64 letters!");
    if(
style == 2) return SendClientMessage(playerid, -1"Bug with style 2! Do not use it!");
    if (
style || style 6) return SendClientMessage(playerid, -1,"Invalid style");
    if (
time 20*1000) return SendClientMessage(playerid, -1"No longer than 20 seconds");
    if(
PlayerInfo[playerid][pRank] >= && PlayerInfo[playerid][pRank] <= 8)
    
GameTextForAll(texttimestyle);
    return 
1;

Reply
#5

It should work
Код:
CMD:announce(playerid, params[]) 
{ 
    new text[64], time, style; 
    if(PlayerInfo[playerid][pRank] >= 1 && PlayerInfo[playerid][pRank] <= 8)
    {
        if(sscanf(params, "iis[64]", style, time, text)) return SendClientMessage(playerid, -1, "Usage: /announce <style[0-6]> <time in ms> <text>"); 
        if(strlen(text) > 64) return SendClientMessage(playerid, -1, "Message too long, please make it with less than 64 letters!"); 
        if(style == 2) return SendClientMessage(playerid, -1, "Bug with style 2! Do not use it!"); 
        if(style < 0 || style > 6) return SendClientMessage(playerid, -1,"Invalid style"); 
        if(time > 20*1000) return SendClientMessage(playerid, -1, "No longer than 20 seconds"); 
        GameTextForAll(text, time, style); 
    } 
    return 1; 
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)