05.01.2015, 16:28
Hello, I wanted to put a couple of commands into one command. I wanted it has /refund <ID> <Vehicle/Money etc..>
I don't know how I would put it into a single command, here is the commands if you are able to show me how to make it into the single command.
If you know how to help it would be great!
I've also got a problem with my money command
It doesn't give the money to the player nor does it tell what has been given.
Thanks you for helping!
I don't know how I would put it into a single command, here is the commands if you are able to show me how to make it into the single command.
pawn Код:
ACMD:vehicle(playerid, params[])
{
if (pInfo[playerid][Adminlevel] < 2) return 0;
new car;
if(sscanf(params, "ud", ID, car)) return SCM(playerid, orange, "Give a player a vehicle: /vehicle <ID> <400 - 611>");
if(ID == IPI) return SCM(playerid, red, "*Player is not connected!");
new Float: x, Float: y, Float: z, Float: a;
GetPlayerPos(ID, x, y, z);
GetPlayerFacingAngle(ID, a);
new rd1 = random(20);
new rd2 = random(20);
format(ustr, sizeof(ustr), "*You have given %s vehicle ID %d", GetName(ID), car);
SCM(playerid, Lblue, ustr);
format(ustr, sizeof(ustr), "%s %s has given you vehicle ID %d", AdminLevelName(playerid), GetName(playerid), car);
SCM(ID, red, ustr);
new veh = CreateVehicle(car, x, y, z, a, rd1, rd2, -1);
PutPlayerInVehicle(ID, veh, 0);
return 1;
}
pawn Код:
CMD:givemoney(playerid, params[])
{
if (pInfo[playerid][Adminlevel] < 2)return 0;
new Amount;
if(sscanf(params,"u",ID, Amount)) return SCM(playerid, orange, "Give money to a player: /givemoney <ID> <Amount>");
GivePlayerMoney(ID, Amount);
GetPlayerName(playerid,pName, MAX_PLAYER_NAME);
format(ustr, sizeof(ustr), "%s %s has given you $%s", AdminLevelName(playerid),pName, Amount);
SCM(ID, red, ustr);
return 1;
}
I've also got a problem with my money command
pawn Код:
CMD:givemoney(playerid, params[])
{
if (pInfo[playerid][Adminlevel] < 2)return 0;
new Amount;
if(sscanf(params,"u",ID, Amount)) return SCM(playerid, orange, "Give money to a player: /givemoney <ID> <Amount>");
GivePlayerMoney(ID, Amount);
GetPlayerName(playerid,pName, MAX_PLAYER_NAME);
format(ustr, sizeof(ustr), "%s %s has given you $%s", AdminLevelName(playerid),pName, Amount);
SCM(ID, red, ustr);
return 1;
}
Thanks you for helping!
![Smiley](images/smilies/smile.png)