SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 23/08/2011, 03:01 PM   #1
Zonoya
Gangsta
 
Zonoya's Avatar
 
Join Date: Jul 2011
Location: Am I in Rio de Janeiro or the Amazon, you tell me?
Posts: 664
Reputation: 19
Default help (AGAIN)

hey guys i took a look at Haydz liferaft script and i got some of its errors out but when i tried to compile it ive narrowed the errors to 4 errors can u help me with em

Code:
Code:
	if (strcmp("/liferaft", cmdtext, true) == 0)
	{
	    veh = GetPlayerVehicleID(playerid);
	    GetVehicleHealth(veh, health);
	    if(IsPlayerInAnyVehicle(playerid)) else SendClientMessage(playerid, COLOR_RED,"You need to be in a plane to deploy the liferafts");
	    if(health >500) return SendClientMessage(playerid,COLOR_RED,"You can only spawn the life raft when you're in an emergency");
	    SendClientMessage(playerid,COLOR_GREEN,"Liferafts deployed");
	    GetPlayerPos(playerid, X, Y, Z);
	    CreateVehicle(473, X, Y, Z-5, 82.2873, 0, 1, 59);
	    }
	return 1;
}
Errors:
Code:
C:\Documents and Settings\Rhys\Desktop\GTA SA Car, plane, Bike, Cleo, Boat ect mods\Carrier Wars\filterscripts\Interiors.pwn(274) : error 010: invalid function or declaration
C:\Documents and Settings\Rhys\Desktop\GTA SA Car, plane, Bike, Cleo, Boat ect mods\Carrier Wars\filterscripts\Interiors.pwn(278) : error 010: invalid function or declaration
C:\Documents and Settings\Rhys\Desktop\GTA SA Car, plane, Bike, Cleo, Boat ect mods\Carrier Wars\filterscripts\Interiors.pwn(279) : error 010: invalid function or declaration
C:\Documents and Settings\Rhys\Desktop\GTA SA Car, plane, Bike, Cleo, Boat ect mods\Carrier Wars\filterscripts\Interiors.pwn(284) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
please help
__________________
Code:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
            {
                SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
                Ban(i); //They are now banned.
            }
        }
    }
    return 1;
}
Zonoya is offline  
Old 23/08/2011, 03:03 PM   #2
Wesley221
High-roller
 
Wesley221's Avatar
 
Join Date: Apr 2011
Posts: 1,564
Reputation: 714
Default Re: help (AGAIN)

Do you have
pawn Code:
Float:x, Float:y, Float:z, Float:health
? If not, add them to your command
__________________
yes
Wesley221 is offline  
Old 23/08/2011, 03:04 PM   #3
Zonoya
Gangsta
 
Zonoya's Avatar
 
Join Date: Jul 2011
Location: Am I in Rio de Janeiro or the Amazon, you tell me?
Posts: 664
Reputation: 19
Default Re: help (AGAIN)

that caused alot of trouble when i added them but ill try again
__________________
Code:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
            {
                SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
                Ban(i); //They are now banned.
            }
        }
    }
    return 1;
}
Zonoya is offline  
Old 23/08/2011, 03:06 PM   #4
Zonoya
Gangsta
 
Zonoya's Avatar
 
Join Date: Jul 2011
Location: Am I in Rio de Janeiro or the Amazon, you tell me?
Posts: 664
Reputation: 19
Default Re: help (AGAIN)

same 4 errors
__________________
Code:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
            {
                SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
                Ban(i); //They are now banned.
            }
        }
    }
    return 1;
}
Zonoya is offline  
Old 23/08/2011, 03:12 PM   #5
Wesley221
High-roller
 
Wesley221's Avatar
 
Join Date: Apr 2011
Posts: 1,564
Reputation: 714
Default Re: help (AGAIN)

pawn Code:
CMD:liferaft(playerid, params[])
{
    new Float:health, Float:X, Float:Y, Float:Z;
    new veh = GetPlayerVehicleID(playerid);
    GetVehicleHealth(veh, health);
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(health >500) return SendClientMessage(playerid,-1,"You can only spawn the life raft when you're in an emergency");
        SendClientMessage(playerid,-1,"Liferafts deployed");
        GetPlayerPos(playerid, X, Y, Z);
        CreateVehicle(473, X, Y, Z-5, 82.2873, 0, 1, 59);
    } else SendClientMessage(playerid, -1,"You need to be in a plane to deploy the liferafts");
    return 1;
}
This worked for me. Just change it back to strcmp
__________________
yes
Wesley221 is offline  
 

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



All times are GMT. The time now is 11:28 AM.


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