SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 12/02/2018, 09:09 PM   #1
enzulikeS
Big Clucker
 
Join Date: Jan 2018
Posts: 140
Reputation: 0
Default invalid expressions and definition does not match

D:\server\gamemodes\ExtremeGame.pwn(2231 : error 029: invalid expression, assumed zero
D:\server\gamemodes\ExtremeGame.pwn(2231 : warning 202: number of arguments does not match definition
D:\server\gamemodes\ExtremeGame.pwn(2231 : warning 202: number of arguments does not match definition
D:\server\gamemodes\ExtremeGame.pwn(4317 : warning 202: number of arguments does not match definition
D:\server\gamemodes\ExtremeGame.pwn(43196) : warning 202: number of arguments does not match definition

Line 22318: return public PayDay(playerid, params);

Code:
 CMD:payday(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
	return public PayDay(playerid, params);
	return 1;
}

43178: GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);

Code:
 	else if(Mobile[playerid] == -3)
			{
				new location[MAX_ZONE_NAME], name[30], strings[128];
				GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
				GetPlayerName(playerid, name, sizeof(name));
				format(strings, sizeof(strings), "Dispatch: %s has reported: '%s' (10-20 %s)", name, text, location);
				SendTeamMessage(8, COLOR_LIGHTBLUE, strings);
				SendTeamMessage(3, COLOR_LIGHTBLUE, strings);
				SendTeamMessage(2, COLOR_LIGHTBLUE, strings);
				SendTeamMessage(1, COLOR_LIGHTBLUE, strings);
				SendClientMessage(playerid, COLOR_WHITE, "(cellphone) 112: Thank you for reporting this incident; a patrol unit is now on its way.");
				SendClientMessage(playerid, COLOR_WHITE, "Your call has been terminated by the other party.");
				RemovePlayerAttachedObject(playerid, 4);
				Mobile[playerid] = -1;
				CellTime[playerid] = 0;
				PlayerInfo[playerid][pSpeaker] = 0;
				SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
			}
43196: GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
Code:
 	new location[MAX_ZONE_NAME], name[30], strings[128];
				GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
				GetPlayerName(playerid, name, sizeof(name));
				format(strings, sizeof(strings), "Dispatch: %s has reported '%s' (10-20 %s)", name, text, location);
				SendTeamMessage(14, COLOR_ALLDEPT, strings);
				SendClientMessage(playerid, COLOR_WHITE, "(cellphone) 112: Thank you for reporting this incident; we are on our way.");
				SendClientMessage(playerid, COLOR_WHITE, "Your call has been terminated by the other party.");
				RemovePlayerAttachedObject(playerid, 4);
				Mobile[playerid] = -1;
				CellTime[playerid] = 0;
				PlayerInfo[playerid][pSpeaker] = 0;
				SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
enzulikeS is offline   Reply With Quote
Old 12/02/2018, 09:14 PM   #2
Mugala
Gangsta
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: behind u
Posts: 645
Reputation: 30
Default Re: invalid expressions and definition does not match

can u show me this function? GetPlayer2DZone
__________________
here to help
Mugala is offline   Reply With Quote
Old 12/02/2018, 10:48 PM   #3
AdamsLT
Big Clucker
 
AdamsLT's Avatar
 
Join Date: Oct 2011
Location: Lithuania
Posts: 115
Reputation: 31
Default Re: invalid expressions and definition does not match

For the PayDay error:
Remove the word public and the return 1 at the end (since your script will never reach that point):
Code:
CMD:payday(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
	return PayDay(playerid, params);
}
For the 2DZone and Payday warnings:
Show us how both of those functions are defined in your gamemode.
I'm taking a guess in the dark here but payday probably doesn't need any params at all (since you received the warning twice? although that seems strange since how will you know which playerid called the function?) and I have no idea about 2DZones.

So yeah, do what Mugala asked, show us GetPlayer2DZone() and PayDay().
AdamsLT is offline   Reply With Quote
Old 12/02/2018, 11:00 PM   #4
AlexMSK
Banned
 
Join Date: Apr 2016
Location: Albania, yez
Posts: 226
Reputation: 61
Default Re: invalid expressions and definition does not match

PHP Code:
CMD:payday(playeridparams[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"You need to log in first.");
    
PayDay(playeridparams); // why params? anyway lol
    
return 1;

read this: http://wiki.sa-mp.com/wiki/Control_Structures

about this:
PHP Code:
                new location[MAX_ZONE_NAME], name[30], strings[128];
                
GetPlayer2DZone(playeridlocationMAX_ZONE_NAME); 
it must be
PHP Code:
new location[MAX_ZONE_NAME];
GetPlayer2DZone(playeridlocationsizeof(location)); 
Before you post try to g00gle your errors like (error 029: invalid expression, assumed zero samp).
AlexMSK is offline   Reply With Quote
Old 13/02/2018, 12:29 PM   #5
enzulikeS
Big Clucker
 
Join Date: Jan 2018
Posts: 140
Reputation: 0
Default Re: invalid expressions and definition does not match

Quote:
Originally Posted by Mugala View Post
can u show me this function? GetPlayer2DZone
i don't have any functions for it... i have only in that code

problem with payday got fixed..
enzulikeS 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
Expressions Do Not Work In SA-MP SQLite DrakeX Bug Reports 6 09/06/2014 10:11 PM
expressions string to expressions? iJumbo Scripting Help 9 05/05/2013 12:56 AM
error 029: invalid expression, assumed zero & warning 202: number of arguments does not match definition Patrick Scripting Help 4 28/02/2013 04:14 PM
Can someone explain to me these expressions? CJoao Help Archive 4 08/08/2011 12:40 AM
Invalid expressions cre8ticity Help Archive 5 28/10/2010 12:15 PM


All times are GMT. The time now is 11:23 AM.


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