te paso el codigo de mi gm de 0, tu adaptalo al tuyo con tus variables, etc..
pawn Код:
zcmd(pagar, playerid, params[])
{
new string[128];
if(!sscanf(params, "di", params[0], params[1])){
if(params[1] > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_GRAD2, "{48CFD7}» {FFFFFF}No posees esa cantidad.");
if(params[1] < 1 || params[1] > 100000) return SendClientMessage(playerid, COLOR_GRAD2, "{48CFD7}» {FFFFFF}Mбximo: $100k");
if(IsPlayerConnected(params[0])){
if (GetPVarInt(playerid, "GiveMoneyTimer") > 0){
format(string, sizeof(string), "{48CFD7}» {FFFFFF}Tienes que esperar %d segundos despuйs de pagado.", GetPVarInt(playerid, "GiveMoneyTimer"));
SendClientMessage(playerid,COLOR_GREY,string);
return 1;
}if(ProxDetectorS(5.0, playerid, params[0])){
Bought(playerid, params[1]);
Earn(params[0], params[1]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerPlaySound(params[0], 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "{48CFD7}» {FFFFFF}* %s saca un poco de dinero (%d$) y se lo da a %s", SacarNombre(playerid), params[1], SacarNombre(params[0]));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string, sizeof(string), "{48CFD7}» {FFFFFF}* %s pagу %d$ a %s", SacarNombre(playerid), params[1], SacarNombre(params[0]));
}else SendClientMessage(playerid, COLOR_GRAD2, "{48CFD7}» {FFFFFF}Jugador muy lejos.");
}else SendClientMessage(playerid, COLOR_GRAD2, "{48CFD7}» {FFFFFF}Esa ID es invбlida.");
}else SendClientMessage(playerid, COLOR_GRAD2, "{48CFD7}» {FFFFFF}* /pagar <jugador> <cantidad>");
return 1;
}
y agrega estos stocks
pawn Код:
stock Bought(playerid, amount)
{
if(IsPlayerConnected(playerid))
{
new a[12];
format(a,sizeof(a),"~r~ -%d$",amount);
GameTextForPlayer(playerid, a, 5000, 1);
DarDinero(playerid, -amount);
PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
}
return 1;
}
stock Earn(playerid, amount){
if(IsPlayerConnected(playerid)){
new a[12];
format(a,sizeof(a),"~g~ %d$",amount);
GameTextForPlayer(playerid, a, 5000, 1);
DarDinero(playerid, amount);
PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
}
return 1;
}
y listo, ya tenes el cmd. avisame si te falla algo