26.01.2011, 11:55
I get a warning with this code. Let me show you.
This: (right under the code above) cannot be reached...
Error Code in the Compiler:
Quite new to scripting gamemodes.
Help me correct this problem?
Thanks.
~Justin
pawn Код:
{
if (strcmp("/heal", cmdtext, true) == 0)
{
GetPlayerMoney (playerid);
if(GetPlayerMoney(playerid) < 300)
{
SendClientMessage(playerid,YELLOW,"[ERROR]: Not enough money!! This costs $300!");
}
else
{
SendClientMessage(playerid,YELLOW,"[PLAYER]: Healed for $300!");
SetPlayerHealth(playerid, 100);
GivePlayerMoney (playerid, -300);
}
return 1;
}
{
if (strcmp("/armour", cmdtext, true) == 0)
{
GetPlayerMoney (playerid);
if(GetPlayerMoney(playerid) < 300)
{
SendClientMessage(playerid,YELLOW,"[ERROR]: Not enough money!!");
}
else
{
SendClientMessage(playerid,YELLOW,"[PLAYER]: Armour given for $300!");
SetPlayerArmour(playerid, 100);
GivePlayerMoney (playerid, -300);
}
return 1;
}
return 0;
}
pawn Код:
if (strcmp("/help", cmdtext, true) == 0)
{
SendClientMessage(playerid,YELLOW,"________________________________________________________________________________________");
SendClientMessage(playerid,YELLOW,"[HELP]: Hello, and welcome to Ultimate Freeroam. This uses a custom script by [UF]Jesco");
SendClientMessage(playerid,YELLOW,"and was created specifically for his first server; Ultimate Freeroam.");
SendClientMessage(playerid,YELLOW,"You can use the command: [/commands] to get a list of commands!");
SendClientMessage(playerid,YELLOW,"________________________________________________________________________________________");
return 1;
}
if (strcmp("/commands", cmdtext, true) == 0)
{
SendClientMessage(playerid,YELLOW,"[COMMANDLIST]: /heal; /armour; /register; /login; /admins; /changelog; /report ");
return 1;
}
if (strcmp("/changelog", cmdtext, true) == 0)
{
SendClientMessage(playerid,YELLOW,"___________________________________________");
SendClientMessage(playerid,YELLOW,"Ultimate Freeroam Script Changelog:");
SendClientMessage(playerid,YELLOW,"< Added a /heal and /armour command. >");
SendClientMessage(playerid,YELLOW,"< Added admin and login/register system. >");
SendClientMessage(playerid,YELLOW,"< Added new spawn position. >");
SendClientMessage(playerid,YELLOW,"____________________________________________");
return 1;
}
return 0;
}
Код:
C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(65) : warning 202: number of arguments does not match definition C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(65) : warning 202: number of arguments does not match definition C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(65) : warning 202: number of arguments does not match definition C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(90) : warning 217: loose indentation C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(103) : warning 202: number of arguments does not match definition C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(104) : warning 217: loose indentation C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(111) : warning 217: loose indentation C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(136) : warning 217: loose indentation C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(139) : error 029: invalid expression, assumed zero C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(144) : warning 217: loose indentation C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(146) : warning 217: loose indentation C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(158) : warning 217: loose indentation C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(160) : warning 217: loose indentation C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(164) : warning 225: unreachable code C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(164) : warning 217: loose indentation C:\Program Files\Rockstar Games\Roleplay server 0.223\gamemodes\UltimateFreeroambeta.pwn(189) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
Help me correct this problem?
Thanks.
~Justin