30.10.2015, 17:24
hi there, I have a problem with my /pay command and with the /createcar .
The problem with the /pay is that It doesn't give the money to the playerid, on the action it says that it gives the money to urself and the money doesn't +/-
And with the /createcar . How can I make it when the car is spawned to have its engine off ? I tried for a bit of time but it doesn't spawn the car .
The problem with the /pay is that It doesn't give the money to the playerid, on the action it says that it gives the money to urself and the money doesn't +/-
PHP код:
CMD:pay(playerid, params[])
{
new id, amount, pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME], string[126];
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(id, pName2, sizeof(pName2));
if(!sscanf(params, "ud", id, amount))
{
if(playerid == playerid)
{
if(IsPlayerConnected(id))
{
if(Player[playerid][Money] >= amount)
{
Player[playerid][Money] -= amount;
Player[id][Money] += amount;
format(string, sizeof(string), "%s i-a dat lui %s $%d", pName, pName2, amount);
ProxDetector(30, playerid, string, color_purple, color_purple, color_purple, color_purple, color_purple);
} else SendClientMessage(playerid, color_grey, "Nu ai destui bani !");
} else SendClientMessage(playerid, color_grey, "Acest jucator nu este conectat !");
} else SendClientMessage(playerid, color_grey, "Nu poti sa te platesti singur !");
}
else SendClientMessage(playerid, color_grey, "UTILIZARE:/pay <id> <suma>");
return 1;
}
PHP код:
CMD:createcar(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
if(Player[playerid][Admin] >= 10)
{
new carid, color1, color2, Float:pos[4];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
if (!sscanf(params, "iii", carid, color1, color2))
{
CreateVehicle(carid, pos[0], pos[1], pos[2], pos[3], color1, color2, -1);
}
else SendClientMessage(playerid, color_grey, "UTILIZARE: /createcar <modelid> <color1> <color2>");
}
else SendClientMessage(playerid, 0xFF0000FF, "Nu esti autorizat sa foloseste aceasta comanda.");
}
return 1;
}