Scripting help.
#1

I get a warning with this code. Let me show you.
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;
}
This: (right under the code above) cannot be reached...
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;
}
Error Code in the Compiler:
Код:
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.
Quite new to scripting gamemodes.
Help me correct this problem?
Thanks.

~Justin
Reply


Messages In This Thread
Scripting help. - by [MW2]Jµ§†пс - 26.01.2011, 11:55
Re: Scripting help. - by iggy1 - 26.01.2011, 12:02
Re: Scripting help. - by Mean - 26.01.2011, 12:03
Re: Scripting help. - by [MW2]Jµ§†пс - 26.01.2011, 19:53
Re: Scripting help. - by ricardo178 - 26.01.2011, 19:56

Forum Jump:


Users browsing this thread: 1 Guest(s)