SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 26/03/2020, 06:03 PM   #1
MarianImmortalGod
Big Clucker
 
Join Date: Mar 2018
Posts: 66
Reputation: 1
Default Sscanf id 0 ?

Hello, i have a problema that give's me a headache, i have all my plugins updated to the last that exist, sscanf 2.8.3 plugin + include, but i still get the id 0 problem, or the command wont work on other id, or only id 0 can use commands no one else can.

A command that look like every command that i have

HTML Code:
CMD:goto(playerid, params[])
{
	new id;
	if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, -1, "No permission.");
	if(sscanf(params, "u", id)) return SCM(playerid, -1, "Sintaxa: /goto [ID / Nume]");

	InBizz[id] = 0, InHQ[id] = 0, InHouse[id] = 0;
	new Float:x, Float:y, Float:z;
    GetPlayerPos(id, x, y, z);
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
	SetPlayerInterior(playerid, GetPlayerInterior(id));
	SetPlayerPos(playerid, x, y+1, z);

	format(gString, sizeof(gString), "[AdmCMD]: Adminul %s s-a teleportat la %s[%d].", GetName(playerid), GetName(id), id);
    SendAdminsMessage(1, COLOR_LIGHTRED, gString);
	return 1;
}
MarianImmortalGod is offline   Reply With Quote
Old 26/03/2020, 06:06 PM   #2
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 829
Reputation: 68
Default Re: Sscanf id 0 ?

First of all, try to check if player is connected before doing any further actions:

pawn Code:
if(!IsPlayerConnected(id)) return SCM(playerid, -1, "Player is not connected.");

Second: Try to use r specifier instead of u.

And move the pAdmin check above "new id" declaration.
__________________


"A server owner shouldn't be embarrassed or have fear to request help, because we're humans and we never stop learning."
Symon is online now   Reply With Quote
Old 26/03/2020, 08:27 PM   #3
MarianImmortalGod
Big Clucker
 
Join Date: Mar 2018
Posts: 66
Reputation: 1
Default Re: Sscanf id 0 ?

Quote:
Originally Posted by Symon View Post
First of all, try to check if player is connected before doing any further actions:

pawn Code:
if(!IsPlayerConnected(id)) return SCM(playerid, -1, "Player is not connected.");

Second: Try to use r specifier instead of u.

And move the pAdmin check above "new id" declaration.
Thanks, i'll try
MarianImmortalGod 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 [Help] (sscanf warning: Invalid data length.) rajabilal555 Scripting Help 1 21/06/2016 11:14 AM
[HELP]Is it possible? To Color Embed in SSCANF? Maybe SSCANF Bug/ISSUE? Guest4390857394857 Scripting Help 14 30/07/2014 04:11 AM
sscanf & zcmd help..! sscanf inside strcmp PaulDinam Scripting Help 2 26/02/2013 12:47 PM
help !! sscanf - sscanf error: System not initialised. zod23 Scripting Help 1 03/08/2012 08:54 AM
sscanf - sscanf error: System not initialised. Deal-or-die Scripting Help 4 26/06/2012 02:44 PM


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


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