11.06.2012, 16:17
Ok, so I have the below code, and actually several places in my entire code where I would like to increase something by [number], but I just cant figure out how its done, I am sure its something simple, but I have just not figured it out.
I get the error "warning 215: expression has no effect" on this line "ServerHours+number;"
it works fine if I have "ServerHours++;" but how would I go about doing something like "ServerHours+10;"
or as in my code below where I can type in the hours I want to increase the time by.
Thanks!
I get the error "warning 215: expression has no effect" on this line "ServerHours+number;"
it works fine if I have "ServerHours++;" but how would I go about doing something like "ServerHours+10;"
or as in my code below where I can type in the hours I want to increase the time by.
pawn Код:
//========================================[Increase world time]=========================================
YCMD:time(playerid, params[], help)
{
if (help)
{
SendClientMessage(playerid, 0xFF0000AA, "Increases time by [number] hours");
}
else
{
if (IsPlayerAdmin ( playerid )) // If the player is logged into RCON
{
new number;
if(sscanf(params,"n", number))return SendClientMessage(playerid, 0xFF0000AA, "Numbers only!");
ServerHours+number;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Admin only command");
}
}
return 1;
}