SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 25/03/2013, 05:30 PM   #1
Zalman
Big Clucker
 
Join Date: Feb 2013
Posts: 73
Reputation: 1
Default [17:50:56] sscanf warning: 'z' is deprecated, consider using 'S' instead. [17:50:56] sscanf warning: No default value fo

code:
pawn Code:
command(movelocation, playerid, params[])
{
    new Location[128];
    if(sscanf(params, "z", Location))
    {
        if(Player[playerid][AdminLevel] >= 5)
        {
            SendClientMessage(playerid, WHITE, "SYNTAX: /movelocation [usage]");
            SendClientMessage(playerid, GREY, "Prison, Jail, Spawn, LockerPos, Hospital, ArrestPos, BankInt, BankExt, OwnedCarSpawn");
            SendClientMessage(playerid, GREY, "LockerPos2, Harvest1, Harvest2, Harvest3, Harvest4, Harvest5, VipClubPos, VipLockerPos");
        }
    }
    else
    {
        if(Player[playerid][AdminLevel] >= 5)
        {
            if(strcmp(Location, "Prison", true) == 0)
            {
                GetPlayerPos(playerid, Prison1X, Prison1Y, Prison1Z);
                Prison1Int = GetPlayerInterior(playerid);
                Prison1World = GetPlayerVirtualWorld(playerid);
               
                dini_FloatSet("Assets.ini", "Prison1X", Prison1X);
                dini_FloatSet("Assets.ini", "Prison1Y", Prison1Y);
                dini_FloatSet("Assets.ini", "Prison1Z", Prison1Z);
                dini_IntSet("Assets.ini", "Prison1Int", Prison1Int);
                dini_IntSet("Assets.ini", "Prison1World", Prison1World);
               
                SendClientMessage(playerid, WHITE, "You have successfully re-located the Prison location.");
            }
            else if(strcmp(Location, "Harvest1", true) == 0)
            {
                GetPlayerPos(playerid, Harvest1X, Harvest1Y, Harvest1Z);

                dini_FloatSet("Assets.ini", "Harvest1X", Harvest1X);
                dini_FloatSet("Assets.ini", "Harvest1Y", Harvest1Y);
                dini_FloatSet("Assets.ini", "Harvest1Z", Harvest1Z);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the Harvest1 location.");
            }
            else if(strcmp(Location, "Harvest2", true) == 0)
            {
                GetPlayerPos(playerid, Harvest2X, Harvest2Y, Harvest2Z);

                dini_FloatSet("Assets.ini", "Harvest2X", Harvest2X);
                dini_FloatSet("Assets.ini", "Harvest2Y", Harvest2Y);
                dini_FloatSet("Assets.ini", "Harvest2Z", Harvest2Z);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the Harvest2 location.");
            }
            else if(strcmp(Location, "Harvest3", true) == 0)
            {
                GetPlayerPos(playerid, Harvest3X, Harvest3Y, Harvest3Z);

                dini_FloatSet("Assets.ini", "Harvest3X", Harvest3X);
                dini_FloatSet("Assets.ini", "Harvest3Y", Harvest3Y);
                dini_FloatSet("Assets.ini", "Harvest3Z", Harvest3Z);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the Harvest3 location.");
            }
            else if(strcmp(Location, "Harvest4", true) == 0)
            {
                GetPlayerPos(playerid, Harvest4X, Harvest4Y, Harvest4Z);

                dini_FloatSet("Assets.ini", "Harvest4X", Harvest4X);
                dini_FloatSet("Assets.ini", "Harvest4Y", Harvest4Y);
                dini_FloatSet("Assets.ini", "Harvest4Z", Harvest4Z);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the Harvest4 location.");
            }
            else if(strcmp(Location, "Harvest5", true) == 0)
            {
                GetPlayerPos(playerid, Harvest5X, Harvest5Y, Harvest5Z);

                dini_FloatSet("Assets.ini", "Harvest5X", Harvest5X);
                dini_FloatSet("Assets.ini", "Harvest5Y", Harvest5Y);
                dini_FloatSet("Assets.ini", "Harvest5Z", Harvest5Z);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the Harvest5 location.");
            }
            else if(strcmp(Location, "OwnedCarSpawn", true) == 0)
            {
                GetPlayerPos(playerid, OwnedCarSpawnX, OwnedCarSpawnY, OwnedCarSpawnZ);

                dini_FloatSet("Assets.ini", "OwnedCarSpawnX", OwnedCarSpawnX);
                dini_FloatSet("Assets.ini", "OwnedCarSpawnY", OwnedCarSpawnY);
                dini_FloatSet("Assets.ini", "OwnedCarSpawnZ", OwnedCarSpawnZ);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the Owned Car Spawn location.");
            }
            else if(strcmp(Location, "BankExt", true) == 0)
            {
                GetPlayerPos(playerid, BankExtX, BankExtY, BankExtZ);
               
                DestroyDynamicPickup(BankPickupID);
                BankPickupID = CreateDynamicPickup(1239, 23, BankExtX, BankExtY, BankExtZ, 0, -1, -1, 150.0);
               
                dini_FloatSet("Assets.ini", "BankExtX", BankExtX);
                dini_FloatSet("Assets.ini", "BankExtY", BankExtY);
                dini_FloatSet("Assets.ini", "BankExtZ", BankExtZ);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the BankExt location.");
            }
            else if(strcmp(Location, "DropCar", true) == 0)
            {
                GetPlayerPos(playerid, DropCarX, DropCarY, DropCarZ);

                dini_FloatSet("Assets.ini", "DropCarX", DropCarX);
                dini_FloatSet("Assets.ini", "DropCarY", DropCarY);
                dini_FloatSet("Assets.ini", "DropCarZ", DropCarZ);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the DropCar location.");
            }
            else if(strcmp(Location, "BankInt", true) == 0)
            {
                GetPlayerPos(playerid, BankIntX, BankIntY, BankIntZ);
                BankIntID = GetPlayerInterior(playerid);

                dini_FloatSet("Assets.ini", "BankIntX", BankIntX);
                dini_FloatSet("Assets.ini", "BankIntY", BankIntY);
                dini_FloatSet("Assets.ini", "BankIntZ", BankIntZ);
                dini_IntSet("Assets.ini", "BankIntID", BankIntID);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the BankInt location.");
            }
            else if(strcmp(Location, "ArrestPos", true) == 0)
            {
                GetPlayerPos(playerid, ArrestPosX, ArrestPosY, ArrestPosZ);
               
                DestroyDynamicPickup(ArrestPosPickup);

                dini_FloatSet("Assets.ini", "ArrestPosX", ArrestPosX);
                dini_FloatSet("Assets.ini", "ArrestPosY", ArrestPosY);
                dini_FloatSet("Assets.ini", "ArrestPosZ", ArrestPosZ);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the ArrestPos location.");

                ArrestPosPickup = CreateDynamicPickup(1239, 23, ArrestPosX, ArrestPosY, ArrestPosZ, 0, -1, -1, 150.0);
            }
            else if(strcmp(Location, "Jail", true) == 0)
            {
                GetPlayerPos(playerid, Prison2X, Prison2Y, Prison2Z);
                Prison2Int = GetPlayerInterior(playerid);
                Prison2World = GetPlayerVirtualWorld(playerid);

                dini_FloatSet("Assets.ini", "Prison2X", Prison2X);
                dini_FloatSet("Assets.ini", "Prison2Y", Prison2Y);
                dini_FloatSet("Assets.ini", "Prison2Z", Prison2Z);
                dini_IntSet("Assets.ini", "Prison2Int", Prison2Int);
                dini_IntSet("Assets.ini", "Prison2World", Prison2World);
               
                SendClientMessage(playerid, WHITE, "You have successfully re-located the Jail location.");
            }
            else if(strcmp(Location, "Hospital", true) == 0)
            {
                GetPlayerPos(playerid, HospitalSpawnX, HospitalSpawnY, HospitalSpawnZ);
                HospitalInt = GetPlayerInterior(playerid);

                dini_FloatSet("Assets.ini", "HospitalSpawnX", HospitalSpawnX);
                dini_FloatSet("Assets.ini", "HospitalSpawnY", HospitalSpawnY);
                dini_FloatSet("Assets.ini", "HospitalSpawnZ", HospitalSpawnZ);
                dini_IntSet("Assets.ini", "HospitalInt", HospitalInt);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the Hospital.");
            }
            else if(strcmp(Location, "LockerPos2", true) == 0)
            {
                GetPlayerPos(playerid, LockerPos2X, LockerPos2Y, LockerPos2Z);
                LockerPos2Int = GetPlayerInterior(playerid);

                dini_FloatSet("Assets.ini", "LockerPos2X", LockerPos2X);
                dini_FloatSet("Assets.ini", "LockerPos2Y", LockerPos2Y);
                dini_FloatSet("Assets.ini", "LockerPos2Z", LockerPos2Z);
                dini_IntSet("Assets.ini", "LockerPos2Int", LockerPos2Int);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the LockerPos2 location.");
            }
            else if(strcmp(Location, "LockerPos", true) == 0)
            {
                GetPlayerPos(playerid, LockerPosX, LockerPosY, LockerPosZ);
                LockerPosInt = GetPlayerInterior(playerid);

                dini_FloatSet("Assets.ini", "LockerPosX", LockerPosX);
                dini_FloatSet("Assets.ini", "LockerPosY", LockerPosY);
                dini_FloatSet("Assets.ini", "LockerPosZ", LockerPosZ);
                dini_IntSet("Assets.ini", "LockerPosInt", LockerPosInt);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the LockerPos location.");
            }
            else if(strcmp(Location, "Spawn", true) == 0)
            {
                GetPlayerPos(playerid, SpawnX, SpawnY, SpawnZ);

                SpawnInt = GetPlayerInterior(playerid);
                SpawnWorld = GetPlayerVirtualWorld(playerid);

                dini_FloatSet("Spawn.ini", "SpawnX", SpawnX);
                dini_FloatSet("Spawn.ini", "SpawnY", SpawnY);
                dini_FloatSet("Spawn.ini", "SpawnZ", SpawnZ);
                dini_IntSet("Spawn.ini", "SpawnInt", SpawnInt);
                dini_IntSet("Spawn.ini", "SpawnWorld", SpawnWorld);
                SendClientMessage(playerid, WHITE, "You have successfully re-located the Spawn location.");
            }
            else if(strcmp(Location, "VipClubPos", true) == 0)
            {
                GetPlayerPos(playerid, VipClubPosX, VipClubPosY, VipClubPosZ);
                VipClubVW = GetPlayerVirtualWorld(playerid);
                VipClubInteriorID = GetPlayerInterior(playerid);

                DestroyDynamicPickup(VipClubPickup);

                dini_FloatSet("Assets.ini", "VipClubPosX", VipClubPosX);
                dini_FloatSet("Assets.ini", "VipClubPosY", VipClubPosY);
                dini_FloatSet("Assets.ini", "VipClubPosZ", VipClubPosZ);
                dini_IntSet("Assets.ini", "VipClubVW", VipClubVW);
                dini_IntSet("Assets.ini", "VipClubInteriorID", VipClubInteriorID);

                SendClientMessage(playerid, WHITE, "You have successfully re-located the VipClubPos location.");

                VipClubPickup = CreateDynamicPickup(1239, 23, VipClubPosX, VipClubPosY, VipClubPosZ, VipClubVW, VipClubInteriorID, -1, 150.0);
            }
            else if(strcmp(Location, "VipLockerPos", true) == 0)
            {
                GetPlayerPos(playerid, VipLockerPosX, VipLockerPosY, VipLockerPosZ);
                VipLockerVW = GetPlayerVirtualWorld(playerid);
                VipLockerInteriorID = GetPlayerInterior(playerid);

                DestroyDynamicPickup(VipLockerPickup);

                dini_FloatSet("Assets.ini", "VipLockerPosX", VipLockerPosX);
                dini_FloatSet("Assets.ini", "VipLockerPosY", VipLockerPosY);
                dini_FloatSet("Assets.ini", "VipLockerPosZ", VipLockerPosZ);
                dini_IntSet("Assets.ini", "VipLockerVW", VipLockerVW);
                dini_IntSet("Assets.ini", "VipLockerInteriorID", VipLockerInteriorID);

                SendClientMessage(playerid, WHITE, "You have successfully re-location the VipLockerPos location.");

                VipLockerPickup = CreateDynamicPickup(1239, 23, VipLockerPosX, VipLockerPosY, VipLockerPosZ, VipLockerVW, VipLockerInteriorID, -1, 150.0);
            }
            else
            {
                SendClientMessage(playerid, WHITE, "Invalid location.");
            }
        }
    }
    return 1;
}

And could you tell me what is wrong so I can fix it in the future.
Zalman is offline   Reply With Quote
Old 25/03/2013, 05:31 PM   #2
kamzaf
Huge Clucker
 
Join Date: Aug 2010
Location: Canada
Posts: 247
Reputation: 20
Default Re: [17:50:56] sscanf warning: 'z' is deprecated, consider using 'S' instead. [17:50:56] sscanf warning: No default valu

if(sscanf(params, "z", Location)) change to: if(sscanf(params, "s[128]", Location))

Code:
Function:
	sscanf
Params:
	string[] - String to extract parameters from.
	format[] - Parameter types to get.
	{Float,_}:... - Data return variables.
Return:
	0 - Successful, not 0 - fail.
Notes:
	A fail is either insufficient variables to store the data or insufficient
	data for the format string - excess data is disgarded.
 
	A string in the middle of the input data is extracted as a single word, a
	string at the end of the data collects all remaining text.
 
	The format codes are:
 
	c - A character.
	d, i - An integer.
	h, x - A hex number (e.g. a colour).
	f - A float.
	s - A string.
	z - An optional string.
	pX - An additional delimiter where X is another character.
	'' - Encloses a litteral string to locate.
	u - User, takes a name, part of a name or an id and returns the id if they're connected.
kamzaf is offline   Reply With Quote
Old 25/03/2013, 05:33 PM   #3
Zalman
Big Clucker
 
Join Date: Feb 2013
Posts: 73
Reputation: 1
Default Re: [17:50:56] sscanf warning: 'z' is deprecated, consider using 'S' instead. [17:50:56] sscanf warning: No default valu

Quote:
Originally Posted by kamzaf View Post
if(sscanf(params, "z", Location)) change to: if(sscanf(params, "s[128]", Location))

Code:
Function:
	sscanf
Params:
	string[] - String to extract parameters from.
	format[] - Parameter types to get.
	{Float,_}:... - Data return variables.
Return:
	0 - Successful, not 0 - fail.
Notes:
	A fail is either insufficient variables to store the data or insufficient
	data for the format string - excess data is disgarded.
 
	A string in the middle of the input data is extracted as a single word, a
	string at the end of the data collects all remaining text.
 
	The format codes are:
 
	c - A character.
	d, i - An integer.
	h, x - A hex number (e.g. a colour).
	f - A float.
	s - A string.
	z - An optional string.
	pX - An additional delimiter where X is another character.
	'' - Encloses a litteral string to locate.
	u - User, takes a name, part of a name or an id and returns the id if they're connected.
Thanks for the quick reply and thanks.
Zalman 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 warning: Strings without a length are deprecated, please add a destination size. niels44 Scripting Help 11 24/10/2012 05:35 PM
[HELP]sscanf warning: Unenclosed specifier parameters are deprecated, consider using something like p<,>. Orhun_Kaya Scripting Help 3 18/07/2012 12:27 PM
[HELP]sscanf warning: Unenclosed specifier parameters are deprecated, consider using something like p<,>. Orhun_Kaya Scripting Help 7 29/06/2012 10:06 AM
sscanf warning: Strings without a length are deprecated, please add a destination size. HayZatic Help Archive 5 08/07/2011 06:26 PM


All times are GMT. The time now is 11:11 PM.


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