SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 02/06/2013, 07:58 AM   #1
OpticKiller
Banned
 
Join Date: May 2013
Location: N/A
Posts: 524
Reputation: -13
Default sscanf issue

everytime i type enter or exit i get a sscanf warning.


Code:
[08:55:31] sscanf warning: No default value found.
Code:
CMD:enter(playerid, params[])
{
	for(new i = 0; i < sizeof(HouseInfo); i++)
	{
		if (IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ])) {
			if(PlayerInfo[playerid][pPhousekey] == i || PlayerInfo[playerid][pPhousekey2] == i || HouseInfo[i][hLock] == 0 || PlayerInfo[playerid][pRenting] == i) {
				SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);
				PlayerInfo[playerid][pInt] = HouseInfo[i][hHInteriorWorld];
				PlayerInfo[playerid][pLocal] = i+6000;
				PlayerInfo[playerid][pVW] = i+6000;
				SetPlayerVirtualWorld(playerid, i+6000);
				if(HouseInfo[i][hCustomInterior] == 1)
				{
					TogglePlayerControllable(playerid, 0);
				}
				SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
				SetPlayerFacingAngle(playerid,HouseInfo[i][hInteriorA]);
				SetCameraBehindPlayer(playerid);
				GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
				Streamer_UpdateEx(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
			}
			else
			{
				GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
			}
			return 1;
		}
	}
	EnteredInterior[playerid] = true;
	return 1;
}



Code:
CMD:exit(playerid, params[])
{
	for(new i = 0; i <  sizeof(HouseInfo); i++) {
		if (IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && PlayerInfo[playerid][pVW] == i+6000) {
			SetPlayerInterior(playerid,0);
			PlayerInfo[playerid][pInt] = 0;
			PlayerInfo[playerid][pLocal] = 255;
			if(HouseInfo[i][hCustomExterior]) {
				TogglePlayerControllable(playerid, 0);
			}
			SetPlayerPos(playerid,HouseInfo[i][hExteriorX],HouseInfo[i][hExteriorY],HouseInfo[i][hExteriorZ]);
			SetPlayerFacingAngle(playerid, HouseInfo[i][hExteriorA]);
			SetCameraBehindPlayer(playerid);
			SetPlayerVirtualWorld(playerid, 0);
			PlayerInfo[playerid][pVW] = 0;
			return Streamer_UpdateEx(playerid, HouseInfo[i][hExteriorX],HouseInfo[i][hExteriorY],HouseInfo[i][hExteriorZ]);
		}
	}
	EnteredInterior[playerid] = false;
	return 1;
}
OpticKiller is offline   Reply With Quote
Old 02/06/2013, 08:13 AM   #2
Faisal_khan
High-roller
 
Faisal_khan's Avatar
 
Join Date: Feb 2012
Location: Ireland and India
Posts: 1,826
Reputation: 208
Default Re: sscanf issue

Quote:
Originally Posted by ****** View Post
  • sscanf warning: Empty default values.

An optional specifier has been set as (for example):

Code:
I()
Instead of:

Code:
I(42)
This does not apply to strings as they can be legitimately empty.
Make sure you specified a value to the string anywhere in your code.
__________________
Not a SAMP Dev. anymore.
Faisal_khan is offline   Reply With Quote
Old 02/06/2013, 08:18 AM   #3
OpticKiller
Banned
 
Join Date: May 2013
Location: N/A
Posts: 524
Reputation: -13
Default Re: sscanf issue

dont really understand that.
OpticKiller is offline   Reply With Quote
Old 02/06/2013, 08:28 AM   #4
ReVo_
Gangsta
 
ReVo_'s Avatar
 
Join Date: Oct 2009
Posts: 530
Reputation: 73
Default Re: sscanf issue

I can't see any sscanf line in your code man lol. Anyway, when you use "I" you should add () which contain default value to be taken by variable
ReVo_ 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
Sscanf Issue. Need help. se7evolution Server Support 27 20/06/2012 05:33 PM
SSCANF Issue Deduction Scripting Help 8 14/05/2012 05:59 AM
Issue with sscanf Dokins Scripting Help 4 21/01/2012 04:33 PM
Sscanf ID 0 Issue Shockey HD Scripting Help 6 21/12/2011 04:08 AM
Issue with sscanf Warlock Help Archive 8 04/08/2010 04:28 PM


All times are GMT. The time now is 12:45 PM.


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