SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 18/02/2013, 12:59 AM   #1
Ananisiki
High-roller
 
Join Date: Mar 2010
Posts: 1,063
Reputation: 5
Default /fix problem

~~~~~~~~

Last edited by Ananisiki; 15/12/2013 at 05:16 PM.
Ananisiki is offline   Reply With Quote
Old 18/02/2013, 04:40 AM   #2
Jewell
Big Clucker
 
Jewell's Avatar
 
Join Date: Jan 2013
Posts: 136
Reputation: 23
Default Re: /fix problem

pawn Code:
CMD:fix(playerid, params[])
{
    #pragma unused params
    if(isDead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
    if(IsPlayerInAnyVehicle(playerid)) {
    SetVehicleHealth(GetPlayerVehicleID(playerid),1000 .0);
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Your Vehicle Has Been Successfully Repaired.");
    return 1;
    }
    else
    {
    return SendClientMessage(playerid, COLOR_RED, "You Must Be In A Vehicle To Use This Command.");
    }
   return 1;
}
You should return the command to avoid unknown command message.
Jewell is offline   Reply With Quote
Old 18/02/2013, 10:39 PM   #3
Ananisiki
High-roller
 
Join Date: Mar 2010
Posts: 1,063
Reputation: 5
Default Re: /fix problem

~~~~~~~~

Last edited by Ananisiki; 15/12/2013 at 05:17 PM.
Ananisiki is offline   Reply With Quote
Old 18/02/2013, 10:49 PM   #4
CoaPsyFactor
Gangsta
 
Join Date: Jul 2010
Location: Belgrade, Serbia
Posts: 867
Reputation: 52
Default Re: /fix problem

remove last return 1; cus if you can see, it will never go to that part of code, because you have return in if and else
__________________
Quote:
Originally Posted by ThaiLuan View Post
Code:
C:\Users\Administrator\Downloads\Viet-RP\gamemodes\3mien.pwn(112016) : fatal error 101: cannot write to file: "disk full"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Help me! How to fix error
CoaPsyFactor is offline   Reply With Quote
Old 19/02/2013, 01:22 PM   #5
Ananisiki
High-roller
 
Join Date: Mar 2010
Posts: 1,063
Reputation: 5
Default Re: /fix problem

~~~~~~~~

Last edited by Ananisiki; 15/12/2013 at 05:17 PM.
Ananisiki is offline   Reply With Quote
Old 19/02/2013, 01:33 PM   #6
DaRk_RaiN
Gangsta
 
DaRk_RaiN's Avatar
 
Join Date: Sep 2012
Posts: 973
Reputation: 207
Default Re: /fix problem

pawn Code:
CMD:fix(playerid, params[])
{
    if(isDead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
    if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, COLOR_RED, "You Must Be In A Vehicle To Use This Command.");
    SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Your Vehicle Has Been Successfully Repaired.");
    return 1;
}
DaRk_RaiN is offline   Reply With Quote
Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with time formatted message (or some other problem) CptK Scripting Help 0 02/06/2012 01:11 PM
Wanted problem and neon system problem iRealSAMP Scripting Help 4 04/02/2012 06:22 PM
Problem with Y_ini(Big Problem with this Include+MV Panel) ServerScripter Scripting Help 2 04/09/2011 09:30 PM
[SOLVED] 3 problem's! (1 problem still unsolved, but stopped solving.) Mechscape Help Archive 9 24/12/2009 08:47 PM


All times are GMT. The time now is 10:25 AM.


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