08.05.2011, 21:12
Gente eu to com uma duvida da Transfender, quando eu compro algo de lб, o dinheiro nгo abaixa. Alguem pode ajudar?
public OnEnterExitModShop(playerid, enterexit, interiorid)
{
if(enterexit == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "Belo carro!");
GivePlayerMoney(playerid, -500);
}
return 1;
}
* Cobrar o preзo do componente comprado
#include <GP>
forward VerificarDinheiro(playerid);
new TimerUpdateMoney[MAX_PLAYERS];
public VerificarDinheiro(playerid)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, GP[playerid]);
return 1;
}
// No OnPlayerLogin
TimerUpdateMoney[playerid] = SetTimerEx("VerificarDinheiro", 1000, true, "i", playerid);
#if defined _GP_included #endinput #endif #define _GP_included #pragma library Pcash /* native GivePlayerMoneyEx(playerid, money) native ResetPlayerMoneyEx(playerid) native GetPlayerMoneyEx(playerid) native SetPlayerMoneyEx(playerid, money) */ new GP[MAX_PLAYERS]; stock GivePlayerMoneyEx(playerid, money) { GP[playerid] = GP[playerid] + money; return GP[playerid]; } stock ResetPlayerMoneyEx(playerid) { GP[playerid] = 0; return GP[playerid]; } stock GetPlayerMoneyEx(playerid) { return GP[playerid]; } stock SetPlayerMoneyEx(playerid, money) { GP[playerid] = GP[playerid] - GP[playerid]; GP[playerid] = GP[playerid] + money; return GP[playerid]; }
GivePlayerMoneyEx( playerid, -350 ); /* Mude o 350 para a quantia que quer que retire */
GivePlayerMoneyEx x GivePlayerMoney