SA-MP Forums Archive
robbank cp prob - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: robbank cp prob (/showthread.php?tid=154034)



robbank cp prob - Kar - 12.06.2010

i want this like
Код:
if(strcmp(cmdtext, "/robbank", true) == 0) // If they type /robbank
{
if(IsPlayerInCheckpoint(playerid)) // Check if they are in a checkpoint  <====tag mismatch it's corrected
  {
    new string[128];
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    new cash = random(60000); // random number between 1 & 60000 is the money they will get
    GivePlayerMoney(playerid, cash); // Give the player the money!
    format(string,sizeof(string),"%s has just stolen %d from the bank!",playername,cash);
    SendClientMessageToAll(TEAL,string);
}
return 1;
}
not if there in a checkpoint i want it to be in a specific checkpoint



Re: robbank cp prob - (SF)Noobanatior - 12.06.2010

can i see your onplayerentercp code


Re: robbank cp prob - Kar - 12.06.2010

public OnPlayerEnterDynamicCP(playerid,checkpointid)
{
return 1;
}
Код:
public OnPlayerEnterDynamicCP(playerid,checkpointid)
{
	return 1;
}



Re: robbank cp prob - (SF)Noobanatior - 12.06.2010

where do you add your cps? AddDynamicCheckpoint or somethinbg by the looks




Re: robbank cp prob - Kar - 12.06.2010

under ongamemodeint

CreateDynamicCp()

[edit] did u get my message?

[EDIT]i checked everything nothings missing a bracket<.<


Re: robbank cp prob - TheInnocentOne - 12.06.2010

pawn Код:
new bankrobcp;
That goes anywhere in your script but NOT in a callback or function.

pawn Код:
bankrobcp = CreateDynamicCP(...);
Fill in the ... with what you have now, and replace the old line with that one.

Now, if you want to check if someone is in the checkpoint:

pawn Код:
if(IsPlayerInDynamicCP(playerid, bankrobcp))
{
//code here
}



Re: robbank cp prob - Kar - 12.06.2010

thx but now this prob>.<
Код:
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(239) : error 001: expected token: ";", but found "-identifier-"
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(495) : error 004: function "OnPlayerUpdate" is not implemented
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(590) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(596) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(600) : error 004: function "Encrypt" is not implemented
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(601) : error 004: function "OnPlayerLogin" is not implemented
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(603) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(607) : warning 219: local variable "string" shadows a variable at a preceding level
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(612) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(617) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(620) : error 004: function "Encrypt" is not implemented
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(628) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(642) : error 004: function "OnPlayerLogin" is not implemented
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(643) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(651) : error 004: function "ShowStats" is not implemented
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(658) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(666) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(670) : error 004: function "IsStringAName" is not implemented
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(672) : error 004: function "GetPlayerID" is not implemented
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(694) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(701) : warning 219: local variable "string" shadows a variable at a preceding level
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(709) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(748) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(760) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(769) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(778) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(787) : error 079: inconsistent return types (array & non-array)
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSNR~1.PWN(796) : error 079: inconsistent return types (array & non-array)

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.



Re: robbank cp prob - TheInnocentOne - 12.06.2010

You've missed a closing bracket ( } ) somewhere in your script.


Re: robbank cp prob - Kar - 12.06.2010

o god...


Re: robbank cp prob - TheInnocentOne - 12.06.2010

The missig bracket will most likely be near the line of your first error. Goto the line the first error is on and look around there.