SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/06/2017, 11:32 PM   #1
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Post I need help for /repair and /acceptrepair please

Hi all i would need help for a commands with job mechanic.
Here's how I started (you'll notice I'm new to the script):

Code:
//===============================Reparer======================================//
dcmd_reparer(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == 1)
	{
	new string[128];
	new montant = GivePlayerMoney(playerid, montant);
	new playerid2 = GetPlayerVehicleID(playerid);
	if(sscanf(params, "ud", playerid2, montant)) return SendClientMessage(playerid, -1, "USAGE: /reparer [ID] [montant]");
	{
	if(IsPlayerInAnyVehicle(playerid2))
		{
  		GetPlayerName(playerid, string,sizeof(montant));
  		format(string, sizeof(string), "Vous avez réparé le véhicule de %s pour $%d.", GetPlayerVehicleID(playerid2), GivePlayerMoney(playerid, montant++));
  		SendClientMessage(playerid, COLOR_ORANGE, string);
 		GetPlayerName(playerid2, string, sizeof(montant));
  		format(string, sizeof(string), "Le mécanicien a réparé votre véhicule pour $%d.", GivePlayerMoney(playerid2, montant--));
  		SendClientMessage(playerid2, COLOR_ORANGE, string);
  		RepairVehicle(GetPlayerVehicleID(playerid2));
		}
	else return SendClientMessage(playerid, COLOR_RED,"ERREUR: Le client n'est pas dans son véhicule ou vous n'êtes pas mécanicien!"); 
	}
	if(GetPlayerMoney(playerid2) < montant)
		{
		return SendClientMessage(playerid, COLOR_RED,"ERREUR: Vous n'avez pas asser d'argent sur vous!");
		}
	}
	return 1;
}

Last edited by tekass; 20/06/2017 at 02:11 PM. Reason: New title
tekass is offline   Reply With Quote
Old 06/06/2017, 11:34 PM   #2
Kane
Gangsta
 
Kane's Avatar
 
Join Date: Sep 2012
Posts: 821
Reputation: 125
Default Re: Problem with /repair and /accept repair

Change the "z" in if(sscanf(params, "uz", playerid2, montant)) to a d.

Kane is offline   Reply With Quote
Old 07/06/2017, 12:11 AM   #3
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Default Re: Problem with /repair and /accept repair

Ha yes thanks fot this info

+1 rep for you
tekass is offline   Reply With Quote
Old 07/06/2017, 12:15 AM   #4
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Default Re: Problem with /repair and /accept repair

i need again help for for call "money" whitout the defined with GetPlayerMoney(playerid,money) please.
tekass is offline   Reply With Quote
Old 07/06/2017, 02:34 PM   #5
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Post Re: Problem with /repair and /accept repair

new problem...

Code:
C:\Users\KEVIN\Desktop\New_RP_Life\pawno\include\YSI\..\YSI_Storage\..\YSI_Internal\amx_assembly.inc(38) : fatal error 111: user error: Please update "https://github.com/Zeex/amx_assembly" to get "deref()"


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


1 Error.
i have download y_assembly.inc at https://github.com/Zeex/amx_assembly but it's always the same...

You have idea? :/
tekass is offline   Reply With Quote
Old 07/06/2017, 02:39 PM   #6
MrFantasy
Little Clucker
 
Join Date: Mar 2017
Posts: 36
Reputation: 1
Default Re: Problem with /repair and /accept repair

Search http://forum.sa-mp.com/showthread.php?p=3730318
MrFantasy is offline   Reply With Quote
Old 07/06/2017, 10:03 PM   #7
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Default Re: Problem with /repair and /accept repair

i have extracted the amx_assembly folder in YSI/amx and nothing same with YSI_Internal or Ysi_Storage

i don't know what to do... :/
tekass is offline   Reply With Quote
Old 07/06/2017, 10:56 PM   #8
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Default Re: Problem with /repair and /accept repair

Ha is good it's my command /accepterep but i don't know the relationship with YSI...
The suject is return at the normaly
tekass is offline   Reply With Quote
Old 20/06/2017, 02:15 PM   #9
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Default Re: Problem with /repair and /accept repair

I thinks i need to remake all the command with another method...You have an idea please?
tekass is offline   Reply With Quote
Old 20/06/2017, 03:21 PM   #10
tekass
Little Clucker
 
Join Date: May 2017
Posts: 21
Reputation: 0
Post Re: Problem with /repair and /accept repair

I tried with this new method:

Code:
dcmd_reparer(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == 1)
	{
	new string[128];
	new montant = strval(params);
	new playerid2 = GetPlayerVehicleID(playerid);
	if(sscanf(params, "ud", playerid2, montant)) return SendClientMessage(playerid, -1, "USAGE: /reparer [ID] [montant]");
	{
	if(IsPlayerInAnyVehicle(playerid2))
		{
  		GetPlayerName(playerid, string,sizeof(montant));
  		format(string, sizeof(string), "%s à réparé le véhicule du client pour $%d.",playerid, GivePlayerMoney(playerid, montant));
  		SendClientMessage(playerid, COLOR_ORANGE, string);
 		GetPlayerName(playerid2, string, sizeof(montant));
  		format(string, sizeof(string), "Le mécanicien a réparé votre véhicule pour -$%d.", GivePlayerMoney(playerid2, -montant));
  		SendClientMessage(playerid2, COLOR_ORANGE, string);
  		RepairVehicle(GetPlayerVehicleID(playerid2));
		}
	else return SendClientMessage(playerid, COLOR_RED,"ERREUR: Le client n'est pas dans son véhicule ou vous n'êtes pas mécanicien!");
	}
	if(GetPlayerMoney(playerid2) < montant)
		{
		return SendClientMessage(playerid, COLOR_RED,"ERREUR: Vous n'avez pas asser d'argent sur vous!");
		}
	}
	return 1;
}
tekass 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 /repair command buburuzu19 Scripting Help 1 09/09/2014 07:21 AM
Help to covert /accept bodyguard,refill,repair,drugs,sex to pay in paycheck to pay in cash Camataru7 Scripting Help 1 07/07/2014 10:27 AM
Problem with automatic repair UnlimitedFreeroam Scripting Help 3 12/08/2013 12:28 PM
[FilterScript] Auto Car Repair [Full Repair] Vikshay Filterscripts 1 12/07/2013 10:11 PM
Repair pickup problem joska Scripting Help 7 01/01/2013 12:23 PM


All times are GMT. The time now is 05:02 PM.


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