SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 25/01/2018, 01:52 PM   #1
Longover
Big Clucker
 
Longover's Avatar
 
Join Date: Oct 2017
Location: Romania
Posts: 189
Reputation: 0
Thumbs up SSCANF mystake?

Direct to problem:
Code:
if(sscanf(params, "us", id, reason)) return SCM(playerid, WHITE, "Scrie: /Explode [Nume/ID] [Motiv].");
Translate:
Scrie: /Explode [Nume/ID] [Motiv] = Type: /Explode [Name/ID] [Reason]
I'm give this errors:
Code:
C:\Program Files\eXtreme Stunt World (1)\XSW V1\gamemodes\XSW_Full.pwn(10127) : error 035: argument type mismatch (argument 1)
C:\Program Files\eXtreme Stunt World (1)\XSW V1\gamemodes\XSW_Full.pwn(10136) : warning 213: tag mismatch
C:\Program Files\eXtreme Stunt World (1)\XSW V1\gamemodes\XSW_Full.pwn(10136) : warning 213: tag mismatch
C:\Program Files\eXtreme Stunt World (1)\XSW V1\gamemodes\XSW_Full.pwn(10136) : warning 213: tag mismatch
C:\Program Files\eXtreme Stunt World (1)\XSW V1\gamemodes\XSW_Full.pwn(10149) : warning 202: number of arguments does not match definition
C:\Program Files\eXtreme Stunt World (1)\XSW V1\gamemodes\XSW_Full.pwn(11891) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase
Full cmd:
Code:
CMD:explode(playerid, params)
{
	new id, reason[128], px, pz, py, nameadmin[24], nameexplode[24], string[246], Float:health1, Float:ar1, Float:health2, Float:ar2;
	if(Player[playerid][Level] <= 1) return SendSplitMessage(playerid, RED, "Nivelul tau de admin nu este destul de mare pentru a folosii acesta comanda!");
	if(sscanf(params, "us", id, reason)) return SCM(playerid, WHITE, "Scrie: /Explode [Nume/ID] [Motiv].");
	if(!IsPlayerConnected(id)) return SCM(playerid, RED, "Acest player nu este conectat!");
	if(Player[playerid][Level] <= Player[id][Level]) return SendSplitMessage(playerid, RED, "Nu ai voie sa-i dai explode unui admin de nivel mai mare sau egal cu tine!");
	else if(id == playerid) return SCM(playerid, RED, "Nu ai voie sa-ti dai explode singur!");
	{
	    GetPlayerHealth(id, health1);
	    GetPlayerArmour(id, ar1);
	    GetPlayerName(id, nameexplode, sizeof(nameexplode));
	    GetPlayerName(playerid, nameadmin, sizeof(nameadmin));
	    GetPlayerPos(id, px, py, pz);
	    CreateExplosionForPlayer(id, px, pz, py, 1, 3);
	    format(string, sizeof(string), "I-ai dat explode lui %s, [Motiv: %s]!", nameexplode, reason);
	    SCM(playerid, YELLOW, string);
	    GetPlayerHealth(id, health2);
	    GetPlayerArmour(id, ar2);
		format(string, sizeof(string), "%s - %1.f HP inainte | %1.f Armura inainte.", nameexplode, health1, ar1);
		SCM(playerid, YELLOW, string);
		format(string, sizeof(string), "%s - %1.f HP Acum | %1.f Acum.", nameexplode, health2, ar2);
		SCM(playerid, YELLOW, string);
	    format(string, sizeof(string), "Admin %s ti-a dat explode, [Motiv: %s]!", nameadmin, reason);
	    SCM(id, YELLOW, string);
	    format(string, sizeof(string), "Admin %s i-a dat explode lui %s, [Motiv: %s]!",nameadmin , nameexplode, reason);
	    SendMessageToAdmins(YELLOW, string,1);
	}
	return 1;
}
Sorry for my bad english!
THANKS
Longover is offline   Reply With Quote
Old 25/01/2018, 02:38 PM   #2
alanhutch
Huge Clucker
 
alanhutch's Avatar
 
Join Date: Nov 2010
Location: Florence, Italy. Reputation: 9999
Posts: 363
Reputation: 8
Default Re: SSCANF mystake?

pawn Code:
if(sscanf(params, "us[126]", id, reason)) return SCM(playerid, WHITE, "Scrie: /Explode [Nume/ID] [Motiv].");
alanhutch is offline   Reply With Quote
Old 25/01/2018, 02:43 PM   #3
Marricio
Gangsta
 
Join Date: Dec 2010
Posts: 718
Reputation: 96
Default Re: SSCANF mystake?

Code:
CMD:explode(playerid, params)
{
	new id, reason[128], Float:px, Float:pz, Float:py, nameadmin[24], nameexplode[24], string[246], Float:health1, Float:ar1, Float:health2, Float:ar2;
	if(Player[playerid][Level] <= 1) return SendSplitMessage(playerid, RED, "Nivelul tau de admin nu este destul de mare pentru a folosii acesta comanda!");
	if(sscanf(params, "us[128]", id, reason)) return SCM(playerid, WHITE, "Scrie: /Explode [Nume/ID] [Motiv].");
	if(!IsPlayerConnected(id)) return SCM(playerid, RED, "Acest player nu este conectat!");
	if(Player[playerid][Level] <= Player[id][Level]) return SendSplitMessage(playerid, RED, "Nu ai voie sa-i dai explode unui admin de nivel mai mare sau egal cu tine!");
	else if(id == playerid) return SCM(playerid, RED, "Nu ai voie sa-ti dai explode singur!");
	{
	    GetPlayerHealth(id, health1);
	    GetPlayerArmour(id, ar1);
	    GetPlayerName(id, nameexplode, sizeof(nameexplode));
	    GetPlayerName(playerid, nameadmin, sizeof(nameadmin));
	    GetPlayerPos(id, px, py, pz);
	    CreateExplosionForPlayer(id, px, pz, py, 1, 3);
	    format(string, sizeof(string), "I-ai dat explode lui %s, [Motiv: %s]!", nameexplode, reason);
	    SCM(playerid, YELLOW, string);
	    GetPlayerHealth(id, health2);
	    GetPlayerArmour(id, ar2);
		format(string, sizeof(string), "%s - %1.f HP inainte | %1.f Armura inainte.", nameexplode, health1, ar1);
		SCM(playerid, YELLOW, string);
		format(string, sizeof(string), "%s - %1.f HP Acum | %1.f Acum.", nameexplode, health2, ar2);
		SCM(playerid, YELLOW, string);
	    format(string, sizeof(string), "Admin %s ti-a dat explode, [Motiv: %s]!", nameadmin, reason);
	    SCM(id, YELLOW, string);
	    format(string, sizeof(string), "Admin %s i-a dat explode lui %s, [Motiv: %s]!",nameadmin , nameexplode, reason);
	    SendMessageToAdmins(YELLOW, string,1);
	}
	return 1;
}
Marricio 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 03:19 PM.


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