SA-MP Forums Archive
Undifine 'Params' plz help . - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Undifine 'Params' plz help . (/showthread.php?tid=166825)



Undifine 'Params' plz help . - iRana - 10.08.2010

I have error undifined params but params is already two time used but its giving error in new line here's the code .
Код:
if(strcmp(cmd, "/eventproperties", true) == 0)
	{
	new	desiredhp, desiredarmour, desiredwep1, desiredwep2, desiredwep3, desiredwep4, desiredwep5;
	if( sscanf(params, "eve", desiredhp, desiredarmour, desiredwep1, desiredwep2, desiredwep3, desiredwep4, desiredwep5))
	{
	    	if(PlayerInfo[playerid][pAdmin] >= 3)
	    {
			SendClientMessage( playerid, COLOR_GREY, "SYNTAX - /eventproperties [health] [armour] [weapon1] [weapon2] [weapon3] [weapon4] [weapon5]" );
		}
	}
	else
	{
	    	if(PlayerInfo[playerid][pAdmin] >= 3)
	    {
			    EventHP = desiredhp;
			    EventArmour = desiredarmour;
			    EventWeapon1 = desiredwep1;
			    EventWeapon2 = desiredwep2;
			    EventWeapon3 = desiredwep3;
			    EventWeapon4 = desiredwep4;
			    EventWeapon5 = desiredwep5;
			    GetPlayerPos( playerid, EventX, EventY, EventZ);
			    EventWorld = GetPlayerVirtualWorld( playerid );
			    EventInt = GetPlayerInterior( playerid );
			    SendClientMessage( playerid, COLOR_GREY, "You have set the properties. Type /startevent to start the event, or use the same command to change the properties." );
		    }
 }
	return 1;
}



Re: Undifine 'Params' plz help . - PotH3Ad - 10.08.2010

pawn Код:
if(!strcmp(cmd, "/eventproperties", true))
{
    new desiredhp, desiredarmour, desiredwep1, desiredwep2, desiredwep3, desiredwep4, desiredwep5;
    if(sscanf(cmd, "ddddddd", desiredhp, desiredarmour, desiredwep1, desiredwep2, desiredwep3, desiredwep4, desiredwep5))
    {
        return SendClientMessage( playerid, COLOR_GREY, "SYNTAX - /eventproperties [health] [armour] [weapon1] [weapon2] [weapon3] [weapon4] [weapon5]" );
    }
    else if(PlayerInfo[playerid][pAdmin] >= 3)
    {
        EventHP = desiredhp;
        EventArmour = desiredarmour;
        EventWeapon1 = desiredwep1;
        EventWeapon2 = desiredwep2;
        EventWeapon3 = desiredwep3;
        EventWeapon4 = desiredwep4;
        EventWeapon5 = desiredwep5;
        GetPlayerPos( playerid, EventX, EventY, EventZ);
        EventWorld = GetPlayerVirtualWorld( playerid );
        EventInt = GetPlayerInterior(playerid);
        SendClientMessage(playerid, COLOR_GREY, "You have set the properties. Type /startevent to start the event, or use the same command to change the properties." );
    }
    return 1;
}



Re: Undifine 'Params' plz help . - iRana - 10.08.2010

Its giving me two warning 'Lose identation' where the code start and at line where next code[cmd] start'.


Re: Undifine 'Params' plz help . - [MWR]Blood - 10.08.2010

Quote:
Originally Posted by iRana
Посмотреть сообщение
Its giving me two warning 'Lose identation' where the code start and at line where next code[cmd] start'.
Add
pawn Код:
#pragma tabsize 0
At the top of your script.


Re: Undifine 'Params' plz help . - DiddyBop - 10.08.2010

Quote:
Originally Posted by iRana
Посмотреть сообщение
Its giving me two warning 'Lose identation' where the code start and at line where next code[cmd] start'.
Then learn to indent properly....