SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/01/2020, 08:08 AM   #1
AlexUltimate
Little Clucker
 
Join Date: Jan 2020
Posts: 16
Reputation: 0
Default I need help for this script :( !!

public OnPlayerEnterCheckpoint(playerid)
{
new string[256];
switch(JobCp[playerid]) {
case 1: {
DisablePlayerCheckpoint(playerid);
JobCp[playerid] = 0;
SendClientMessage(playerid, 0xE4810AFF, "Acum poti tasta /startwork!");
}
case 2: SetPlayerCheckpoint(playerid, -2787.7009, -326.3154, 6.1146, 7.0), JobCp[playerid] ++;
case 3: SetPlayerCheckpoint(playerid, -0.8400, -17.5200, 3.5400, 7.0), JobCp[playerid] ++;
case 4: SetPlayerCheckpoint(playerid, -1858.0089, 1398.5632, 6.3920, 7.0), JobCp[playerid] ++;
case 5: SetPlayerCheckpoint(playerid, -1523.4014, 495.0647, 6.4082, 7.0), JobCp[playerid] ++;
case 6: SetPlayerCheckpoint(playerid, -2126.6016, 208.5466, 34.5315, 7.0), JobCp[playerid] ++;
case 7: SetPlayerCheckpoint(playerid, -2780.6438, -320.0563, 6.1670, 7.0), JobCp[playerid] ++;
case 8: {
DisablePlayerCheckpoint(playerid);
new money = 25000 + random(20000);
format(string, sizeof(string) "Ai terminat munca si ai primit $%d !", money);
SendClientMessage(playerid, 0x0F59DAFF, string);
GivePlayerMoney(playerid, money);
FinalJob[playerid];
}

}

return 1;
}




















Have This error&Warning :


C:\Users\Alex Maftei\Desktop\Server! DA DOAMNE!!\pawno\Inceputul.pwn(85) : warning 211: possibly unintended assignment
C:\Users\Alex Maftei\Desktop\Server! DA DOAMNE!!\pawno\Inceputul.pwn(92) : warning 211: possibly unintended assignment
C:\Users\Alex Maftei\Desktop\Server! DA DOAMNE!!\pawno\Inceputul.pwn(99) : warning 211: possibly unintended assignment
C:\Users\Alex Maftei\Desktop\Server! DA DOAMNE!!\pawno\Inceputul.pwn(137) : warning 211: possibly unintended assignment
C:\Users\Alex Maftei\Desktop\Server! DA DOAMNE!!\pawno\Inceputul.pwn(233) : error 001: expected token: ",", but found "-string-"
C:\Users\Alex Maftei\Desktop\Server! DA DOAMNE!!\pawno\Inceputul.pwn(233) : warning 215: expression has no effect
C:\Users\Alex Maftei\Desktop\Server! DA DOAMNE!!\pawno\Inceputul.pwn(233) : warning 215: expression has no effect
C:\Users\Alex Maftei\Desktop\Server! DA DOAMNE!!\pawno\Inceputul.pwn(233) : error 001: expected token: ";", but found ")"
C:\Users\Alex Maftei\Desktop\Server! DA DOAMNE!!\pawno\Inceputul.pwn(233) : error 029: invalid expression, assumed zero
C:\Users\Alex Maftei\Desktop\Server! DA DOAMNE!!\pawno\Inceputul.pwn(233) : fatal error 107: too many error messages on one line

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


4 Errors.
[Finished in 0.2s]



I only need help for line 233
AlexUltimate is offline   Reply With Quote
Old 19/01/2020, 09:06 AM   #2
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 956
Reputation: 167
Default Re: I need help for this script :( !!

Code:
GivePlayerMoney(playerid, money);
FinalJob[playerid];
If `FinalJob` is a function, it needs to be (playerid). If it is a variable, you need to set a value for it.

Warning 211 tells you that you did not use double = for comparing.
pawn Code:
// correct:
if (a == 5)

// wrong:
if (a = 5)
__________________
Calisthenics is offline   Reply With Quote
Old 19/01/2020, 09:08 AM   #3
DatGuySleepy
Little Clucker
 
Join Date: Oct 2015
Posts: 36
Reputation: 11
Default Re: I need help for this script :( !!

Code:
format(string, sizeof(string), "Ai terminat munca si ai primit $%d !", money);
You're missing a comma after "sizeof(string)".
DatGuySleepy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Friend gave me his script and has 26 errors please help! (Script is already released public) Mappers4Life Scripting Help 5 15/05/2013 07:58 PM
Hilfe beim script (es geht um nemesuns Script) godaince1 Scripting Help 0 23/09/2012 03:10 PM
Script Translation/Traduction Script/Traducción guión Jack_Rocker Help Archive 3 22/05/2011 06:34 PM
laptop script, incorporated to my script. result: can't compile to an amx file.. nikoo Help Archive 1 14/11/2009 03:57 AM
How to script a script??? how do u scripted a script, i have no clue HELP! Badandy Help Archive 10 06/06/2009 08:57 PM


All times are GMT. The time now is 12:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.