SA-MP Forums Archive
/slap errors , sscanf +Rep - 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)
+--- Thread: /slap errors , sscanf +Rep (/showthread.php?tid=578922)



/slap errors , sscanf +Rep - ItzRbj - 23.06.2015

after adding the sscanf line the 4 errors started showing up


Script

Код:
ocmd:slap(playerid,params[])
{
	new pID;
	if(!IsPlayerAnAdmin(playerid,2))return SendClientMessage(playerid,COLOR_BLUE,"You're not allowed to use this command");
 	new string[128], string2[128];
	if(sscanf(params,"u",playerid))return SendClientMessage(playerid,COLOR_BLUE,"/SLAP [ID]");
  	format(string,sizeof(string),"You've slapped %s(%d)", pName(pID), pID);
   	format(string2,sizeof(string2),"You've been slapped by Adminstrator");
   	for(new i=0;i<GetMaxPlayers();i++)
	{
		if(IsPlayerConnected(i))
		{
			if(IsPlayerAnAdmin(i,1))
			{
			    format(string2,sizeof(string2),"A: %s [LEVEL %i] used the SLAP command.",pName(playerid),GetPVarInt(playerid,"Admin"));
				SendClientMessage(i,COLOR_ORANGE,string2);
			}
		}
	}
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid,x,y,z);
	SetPlayerPos(playerid,x,y,z+10);
	return 1;
}
errors

Код:
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : error 029: invalid expression, assumed zero
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : error 017: undefined symbol "ocmd_slap"
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : error 029: invalid expression, assumed zero
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : fatal error 107: too many error messages on one line

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


4 Errors.
Thx


Re: /slap errors , sscanf +Rep - NeilC - 23.06.2015

Try this

Код:
CMD:slap(playerid,params[])
{
	new pID, giveplayerid;
	if(!IsPlayerAnAdmin(playerid)) return SendClientMessage(playerid,COLOR_BLUE,"You're not allowed to use this command");
 	new string[128], string2[128];
	if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid,COLOR_BLUE,"/SLAP [ID]");
  	format(string,sizeof(string),"You've slapped %s(%d)", pName(pID), pID);
   	format(string2,sizeof(string2),"You've been slapped by Adminstrator");
   	for(new i=0;i<GetMaxPlayers();i++)
	{
		if(IsPlayerConnected(i))
		{
			if(IsPlayerAnAdmin(i,1))
			{
			    format(string2,sizeof(string2),"A: %s [LEVEL %i] used the SLAP command.",pName(playerid),GetPVarInt(playerid,"Admin"));
			    SendClientMessage(i,COLOR_ORANGE,string2);
			}
		}
	}
	new Float:x, Float:y, Float:z;
	GetPlayerPos(giveplayerid,x,y,z);
	SetPlayerPos(giveplayerid,x,y,z+10);
	return 1;
}
What command processor do you use?
btw i change the part of "playerid" because if you don't change it i think it will slap yourself.


Re : /slap errors , sscanf +Rep - KillerDVX - 23.06.2015

Do you have ocmd include ?

If yes, add this on the top of your scripts :

PHP код:
#include <ocmd> 
KillerDVX,



Re: /slap errors , sscanf +Rep - ItzRbj - 23.06.2015

Quote:
Originally Posted by NeilC
Посмотреть сообщение
Try this

Код:
CMD:slap(playerid,params[])
{
	new pID, giveplayerid;
	if(!IsPlayerAnAdmin(playerid)) return SendClientMessage(playerid,COLOR_BLUE,"You're not allowed to use this command");
 	new string[128], string2[128];
	if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid,COLOR_BLUE,"/SLAP [ID]");
  	format(string,sizeof(string),"You've slapped %s(%d)", pName(pID), pID);
   	format(string2,sizeof(string2),"You've been slapped by Adminstrator");
   	for(new i=0;i<GetMaxPlayers();i++)
	{
		if(IsPlayerConnected(i))
		{
			if(IsPlayerAnAdmin(i,1))
			{
			    format(string2,sizeof(string2),"A: %s [LEVEL %i] used the SLAP command.",pName(playerid),GetPVarInt(playerid,"Admin"));
			    SendClientMessage(i,COLOR_ORANGE,string2);
			}
		}
	}
	new Float:x, Float:y, Float:z;
	GetPlayerPos(giveplayerid,x,y,z);
	SetPlayerPos(giveplayerid,x,y,z+10);
	return 1;
}
What command processor do you use?
btw i change the part of "playerid" because if you don't change it i think it will slap yourself.
Код:
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : error 029: invalid expression, assumed zero
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : error 017: undefined symbol "cmd_slap"
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : error 029: invalid expression, assumed zero
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : fatal error 107: too many error messages on one line

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


4 Errors.



Re : /slap errors , sscanf +Rep - KillerDVX - 23.06.2015

As i said, you are using ocmd but you didn't defined the include.

Try this on top of your scripts :

PHP код:
#include ocmd 
If you don't have the include, you can download it over here : http://pastebin.com/vc9QaXFN

KillerDVX,



Re: /slap errors , sscanf +Rep - NeilC - 23.06.2015

Quote:
Originally Posted by ItzRbj
Посмотреть сообщение
Код:
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : error 029: invalid expression, assumed zero
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : error 017: undefined symbol "cmd_slap"
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : error 029: invalid expression, assumed zero
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(589) : fatal error 107: too many error messages on one line

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


4 Errors.
Add the top of your script

Код:
#include <sscanf>
#include <ocmd> //if you using ocmd
Check your file pawno\include, there is sscanf and ocmd or zcmd?


Re: /slap errors , sscanf +Rep - ItzRbj - 23.06.2015

They are all included


Re : /slap errors , sscanf +Rep - KillerDVX - 23.06.2015

Huh.. ? Impossible.

Show your definitions of includes?



Re: Re : /slap errors , sscanf +Rep - ItzRbj - 23.06.2015

Quote:
Originally Posted by KillerDVX
Посмотреть сообщение
Huh.. ? Impossible.

Show your definitions of includes?
Код:
#include <a_samp>
#include <sscanf2>
#include <streamer>
#include <ocmd>
#include <zcmd>
#include <YSI\y_ini>



Re: /slap errors , sscanf +Rep - Alpay0098 - 23.06.2015

I prefer change your command processor system to ZCMD or stuff.
It would do a lot of good!