Help me with these two errors.
#1

Код:
CMD:God(playerid,params[])
{
    if(PlayerInfo[playerid][pAdminLevel] >=3)
	{
		SetPlayerHealth(playerid,999999);
		SendClientMessage(playerid,COLOR_GREEN,"|**God Activated**|");
            }
        }
        else return SendClientMessage(playerid,COLOR_RED,"  You are not allowed to use this command!");
        return 1;
    }
So thats my code but im getting two errors from

Код:
        else return SendClientMessage(playerid,COLOR_RED,"  You are not allowed to use this command!");
        return 1;
Код:
C:\Documents and Settings\Chris\Desktop\Desktop\Mastalol\Grand Theft Auto San Andreas Samp Server\filterscripts\SideShock.pwn(202) : error 010: invalid function or declaration
C:\Documents and Settings\Chris\Desktop\Desktop\Mastalol\Grand Theft Auto San Andreas Samp Server\filterscripts\SideShock.pwn(203) : error 010: invalid function or declaration
Can someone tell me whats wrong with it?
Reply
#2

Remove return 1;

And make sure you have COLOR_RED defined..
Reply
#3

something is wrong
Код:
MD:God(playerid,params[])
{
if(PlayerInfo[playerid][pAdminLevel] >=3)
{
SetPlayerHealth(playerid,999999);
SendClientMessage(playerid,COLOR_GREEN,"|**God Activated**|");
}
}//and what about this one?
else return SendClientMessage(playerid,COLOR_RED,"  You are not allowed to use this command!");
return 1;
}

P.S Same colors = pairs
Reply
#4

PHP код:
CMD:god(playeridparams[]) 
{
    if(
PlayerInfo[playerid][pAdmin] >= 3)
    {
        
SetPlayerHealth(playerid10000000);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GREY"You are not authorized to use that command!");
    }
    return 
1;

Reply
#5

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
something is wrong
Код:
MD:God(playerid,params[])
{
if(PlayerInfo[playerid][pAdminLevel] >=3)
{
SetPlayerHealth(playerid,999999);
SendClientMessage(playerid,COLOR_GREEN,"|**God Activated**|");
}
}//and what about this one?
else return SendClientMessage(playerid,COLOR_RED,"  You are not allowed to use this command!");
return 1;
}

P.S Same colors = pairs
The errors are gone thanks but, i get Unkown Server Command
Reply
#6

PHP код:
CMD:God(playerid,params[])
{
    
#pragma unused params
    
if(PlayerInfo[playerid][pAdminLevel] < 3) return SendClientMessage(playerid,COLOR_RED,"  You are not allowed to use this command!");
    
SetPlayerHealth(playerid,999999);
    
SendClientMessage(playerid,COLOR_GREEN,"|**God Activated**|");
    return 
1;

Reply
#7

Quote:
Originally Posted by Kush
Посмотреть сообщение
PHP код:
CMD:god(playeridparams[]) 
{
    if(
PlayerInfo[playerid][pAdmin] >= 3)
    {
        
SetPlayerHealth(playerid10000000);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GREY"You are not authorized to use that command!");
    }
    return 
1;

Worked, cool thanks. Is this right for my other command?

Код:
CMD:godcar(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] >= 3)
    {
        if(IsPlayerInAnyVehicle(playerid))
			{
 			SetVehicleHealth(playerid, 999999);
			SendClientMessage(playerid,COLOR_GREEN,"**GodCar Activated**");
    }
    	else
    {
        SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
    }
	    SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle to use this command!");
	}
   	return 1;
}
Reply
#8

PHP код:
CMD:godcar(playeridparams[])
{
    
#pragma unused params
    
if(PlayerInfo[playerid][pAdminLevel] < 3) return SendClientMessage(playeridCOLOR_RED"You are not allowed to use this command!");
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_RED"You must be in a vehicle to use this command!");
    
SetVehicleHealth(GetPlayerVehicleID(playerid), 999999);
    
SendClientMessage(playerid,COLOR_GREEN,"**GodCar Activated**");
    return 
1;

Reply
#9

Learn to indent your code properly and stupid errors like this won't happen. Besides that makes your code much more easily readable for you and whoever might steal your sources!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)