SA-MP Forums Archive
!Help about exsisted script needed! - 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: !Help about exsisted script needed! (/showthread.php?tid=362200)



!Help about exsisted script needed! - bodey3333 - 23.07.2012

First.The first code isn't tried yet. Because GTA SA got deleted from my PC. So please test it and tell me if there is a problem in it.
Code:
 if (strcmp("/announce %s", cmdtext, true, 10) == 0)
		{

	if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You are not authorized to use this command!");

	else

	SendClientMessage(playerid, 0xFF0000FF, "Announcement posted successfully!");
	SendClientMessageToAll(0xFF0000FF, "(( Admin Announcement: %s ))")
		;
Second.This code,Has a problem it doesn't want to get complied there are 5-6 errors while compling. So can you tell me about the right format for fixing it? And please explain the solution.
Code:
	{
	if (strcmp("/sethealth (Player) %s", true, 10) == 0)
	if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You are not authorized to use this command!");

	else
	SendClientMessage(playerid, 0xFF0000FF, " (Player) health was setted to %s .");
    SetPlayerHealth(Player, %s)
	SendClientMessage(Player, 0xFF0000FF, " (playerid) has setted your health to %s . ")
 ;
Errors:-
error 035: argument type mismatch (argument 2)
error 017: undefined symbol "Player"
error 017: undefined symbol "s"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line



Re: !Help about exsisted script needed! - Ranama - 23.07.2012

You'll have to use sscanf to get a variable, or format to set variables in a string, you might not understand it in the start, but read some on how to use it and it'll be easy as hell.
check it out here:
sscanf: https://sampforum.blast.hk/showthread.php?tid=120356
format: https://sampwiki.blast.hk/wiki/Format

By the way, I don't think anyone have the time to test your script, do it yourself when you've got your samp back