Problem with /repair and /accept repair
#1

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):

Код:
//===============================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;
}
Reply
#2

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

Reply
#3

Ha yes thanks fot this info

+1 rep for you
Reply
#4

i need again help for for call "money" whitout the defined with GetPlayerMoney(playerid,money) please.
Reply
#5

new problem...

Код:
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 © 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? :/
Reply
#6

Search https://sampforum.blast.hk/showthread.php?pid=3730318#pid3730318
Reply
#7

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... :/
Reply
#8

Ha is good it's my command /accepterep but i don't know the relationship with YSI...
The suject is return at the normaly
Reply
#9

I thinks i need to remake all the command with another method...You have an idea please?
Reply
#10

I tried with this new method:

Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)