PDA

View Full Version : Weather Change Error + Commands


nicholas1
05/10/2012, 10:44 PM
Here are my commands for my zombie server.

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help", cmdtext, true, 5) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "(ZR Bot)-The owner of this server is [ZR]nicholas1 and [ZR]Survivor!");
SendClientMessage(playerid, COLOR_YELLOW, "(ZR Bot)-Also,the commands in this server are /help and /kill more are coming soon!");
return 1;
}
if (strcmp("/kill", cmdtext, true, 5) == 0)

SetPlayerHealth(playerid, 0);
return 1;

if(strcmp("/wfoggy", cmdtext, true, 5) == 0)

SetWeather(09);
return 1;

For, if(strcmp("/wfoggy", cmdtext, true, 5) == 0) .When I compile I get this.
C:\Documents and Settings\Owner\My Documents\GTA - San Andreas\Server\gamemodes\Z#.pwn(241) : warning 225: unreachable code

Also,if ya see anything wrong with me too add more commands like.For example,/credits for people to see owner and co-owner like that please post it also in reply.I will be so happy. :D

Dizzle
05/10/2012, 10:52 PM
Here you go -

if(strcmp("/wfoggy", cmdtext, true, 5) == 0)
{
SetWeather(09);
return 1;
}

if (strcmp("/kill", cmdtext, true, 5) == 0)
{ // this one
SetPlayerHealth(playerid, 0);
return 1;
} // and this one, same as above

You've forgotten to put the brackets

nicholas1
06/10/2012, 01:27 AM
Thanks help me out alot and I am also coming to your server for a visit :)

nicholas1
06/10/2012, 04:38 AM
thanks once again