PDA

View Full Version : [HELP ME!] Rob Bank Command.


beatsiedude
02/05/2009, 05:40 AM
Hello, I am not very good at scripting with this...
So I would like some help.
Tell me why this isn't working, and show me how I can get it to work.

if(strcmp(cmd, "/robbank", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLocal] == 103 || PlayerToPoint(1.5, playerid, 1346.5016,-1758.7649,13.5156) || PlayerToPoint(1.5, playerid, 1592.7152,-2335.3748,13.5400) || PlayerToPoint(1.5, playerid, 2308.4612,-1634.4176,14.8270) || PlayerToPoint(1.5, playerid, 2865.9014,-1415.4203,11.0061) || PlayerToPoint(1.5, playerid, 2404.5913,-1229.8973,23.8301) || PlayerToPoint(1.5, playerid, 1172.5912,-1328.4365,15.4034))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "You have 5 seconds before the cops are alerted.");
SetTimer("RobBankCop", 50000, 0);
}
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SafeGivePlayerMoney(playerid, 1000000);
GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
{
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");





Here's the error Message

C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15) : error 010: invalid function or declaration
C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15 -- 3) : error 010: invalid function or declaration
C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15 -- 5) : error 010: invalid function or declaration
C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15 -- 8) : error 010: invalid function or declaration
C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15 -- 11) : error 010: invalid function or declaration
C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15 -- 12) : error 054: unmatched closing brace ("}")
C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15 -- 14) : error 010: invalid function or declaration
C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15) : error 010: invalid function or declaration
C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15) : error 010: invalid function or declaration
C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15 -- 18) : error 010: invalid function or declaration
C:\Documents and Settings\HP_Administrator\Desktop\Server\filterscr ipts\robbank.pwn(15 -- 18) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


11 Errors.

beatsiedude
03/05/2009, 04:25 AM
Please?

dafel2
03/05/2009, 06:51 AM
show us more!

miokie
03/05/2009, 09:19 AM
Show the whole command and also what lines are what.

HB
03/05/2009, 09:27 AM
1. Why you check if the player is connected? When the player isn't connected he can't even execute /robbank.
2. You actually say it takes 5 seconds before the cops get known of it, but you set the timer to 50 seconds.

I know that this doesn't fix the bugs you gave us, but this helps you in some way I hope.

beatsiedude
04/05/2009, 02:02 AM
if(strcmp(cmd, "/robbank", true) == 0)
{
if(PlayerInfo[playerid][pLocal] == 103 || PlayerToPoint(1.5, playerid, 1346.5016,-1758.7649,13.5156) || PlayerToPoint(1.5, playerid, 1592.7152,-2335.3748,13.5400) || PlayerToPoint(1.5, playerid, 2308.4612,-1634.4176,14.8270) || PlayerToPoint(1.5, playerid, 2865.9014,-1415.4203,11.0061) || PlayerToPoint(1.5, playerid, 2404.5913,-1229.8973,23.8301) || PlayerToPoint(1.5, playerid, 1172.5912,-1328.4365,15.4034))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "You have 5 seconds before the cops are alerted.");
SetTimer("RobBankCop", 50000, 0);
{
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SafeGivePlayerMoney(playerid, 1000000);
GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
(
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
{
{
{
{
{
{
return 1;
}


There...please help me.

Chris1337
03/04/2012, 12:04 AM
if(strcmp(cmd, "/robbank", true) == 0)
{
if(PlayerInfo[playerid][pLocal] == 103 || PlayerToPoint(1.5, playerid, 1346.5016,-1758.7649,13.5156) || PlayerToPoint(1.5, playerid, 1592.7152,-2335.3748,13.5400) || PlayerToPoint(1.5, playerid, 2308.4612,-1634.4176,14.8270) || PlayerToPoint(1.5, playerid, 2865.9014,-1415.4203,11.0061) || PlayerToPoint(1.5, playerid, 2404.5913,-1229.8973,23.8301) || PlayerToPoint(1.5, playerid, 1172.5912,-1328.4365,15.4034))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "You have 5 seconds before the cops are alerted.");
SetTimer("RobBankCop", 50000, 0);
{
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SafeGivePlayerMoney(playerid, 1000000);
GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
(
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
SendClientMessageToAll(COLOR_RED, "!!!!!!THE BANK IS IN DISTRESS!!!!!!");
{
{
{
{
{
{
return 1;
}


There...please help me.


are you kidding me ?? you open {{{{{{{ when you have to close it }}}}}