SA-MP Forums Archive
Script 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)
+--- Thread: Script help (/showthread.php?tid=600145)



Script help - TheDarkBlade - 04.02.2016

Код:
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42201) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42202) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42204) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42207) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42209) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42211) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42219) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42221) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42226) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42228) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42236) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42239) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42242) : error 010: invalid function or declaration
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42245) : error 010: invalid function or declaration
the code script code is
Код:
CMD:aod
{
	if(IsPlayerConnected(playerid))
	{
	    if(gPlayerLogged[playerid] == 0)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "   You need to login first !");
			return 1;
	    }
	    if(PlayerInfo[playerid][pAdmin] > 0)
	    {
	        if(AdminDuty[playerid] == 0)
	        {
	            AdminDuty[playerid] = 1;
	            SetPlayerArmour(playerid, 99999);
				SetPlayerHealth(playerid, 99999);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "Administratorul {33CCFF}%s{FF9700} este acum la servici. Foloseste {FF002F}/report {FF9700}daca ai nelamuriri!",sendername);
				SendClientMessageToAll(COLOR_Duduianu,string);
				if(PlayerInfo[playerid][pAdmin] >= 5)
				{
				    for(new i = 0; i < sizeof(CarInfo); i++)
					{
						SetVehicleParamsForPlayer(i,playerid,0,0);
					}
				}
				return 1;
	        }
	        else if(AdminDuty[playerid] == 1)
	        {
	            AdminDuty[playerid] = 0;
	            SetPlayerArmour(playerid, 0);
				SetPlayerHealth(playerid, 100);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "Administratorul {33CCFF}%s{FF9700} nu mai este la servici.",sendername);
				SendClientMessageToAll(COLOR_Duduianu,string);
				return 1;
		    }
	    }
	    else
	    {
	        SendClientMessage(playerid, COLOR_GREY, "Nu esti Admin");
	        return 1;
	    }
	}
    return 1;
}



Re: Script help - Karan007 - 04.02.2016

Try this.

PHP код:
CMD:aod(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        if(
gPlayerLogged[playerid] == 0)
        {
            
SendClientMessage(playeridCOLOR_GREY"   You need to login first !");
            return 
1;
        }
        if(
PlayerInfo[playerid][pAdmin] > 0)
        {
            if(
AdminDuty[playerid] == 0)
            {
                
AdminDuty[playerid] = 1;
                
SetPlayerArmour(playerid99999);
                
SetPlayerHealth(playerid99999);
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "Administratorul {33CCFF}%s{FF9700} este acum la servici. Foloseste {FF002F}/report {FF9700}daca ai nelamuriri!",sendername);
                
SendClientMessageToAll(COLOR_Duduianu,string);
                if(
PlayerInfo[playerid][pAdmin] >= 5)
                {
                    for(new 
0sizeof(CarInfo); i++)
                    {
                        
SetVehicleParamsForPlayer(i,playerid,0,0);
                    }
                }
                return 
1;
            }
            else if(
AdminDuty[playerid] == 1)
            {
                
AdminDuty[playerid] = 0;
                
SetPlayerArmour(playerid0);
                
SetPlayerHealth(playerid100);
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "Administratorul {33CCFF}%s{FF9700} nu mai este la servici.",sendername);
                
SendClientMessageToAll(COLOR_Duduianu,string);
                return 
1;
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"Nu esti Admin");
            return 
1;
        }
    }
    return 
1;




Re: Script help - TheDarkBlade - 04.02.2016

Код:
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42235) : error 017: undefined symbol "sendername"
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42235) : error 017: undefined symbol "sendername"
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42235) : error 029: invalid expression, assumed zero
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42235) : fatal error 107: too many error messages on one line



Re: Script help - Yashas - 04.02.2016

Quote:
Originally Posted by TheDarkBlade
Посмотреть сообщение
Код:
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42235) : error 017: undefined symbol "sendername"
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42235) : error 017: undefined symbol "sendername"
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42235) : error 029: invalid expression, assumed zero
C:\Users\TheDarkBlade\Desktop\Serioux RPG V0.5I\gamemodes\serioux5.pwn(42235) : fatal error 107: too many error messages on one line
You need to try fixing these simple errors yourself.

The compiler is complaing about an undefined symbol which means something is being used in your script which hasn't been defined. The compiler says that 'something' is sendername. Since it is a string which stores the player name, declare it as an array with MAX_PLAYER_NAME elements.

Код:
new sendername[MAX_PLAYER_NAME];