CMD:carhealth(playerid,params)
{
new pid, ch = GetPlayerVehicleID(playerid), str[128], pidn[MAX_PLAYER_NAME], amount;
if(!IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_RED,"ERROR: You must be an RCON to use this command!");
if(sscanf(params,"ui", pid, amount)) return SCM(playerid,COLOR_RED,"USAGE: /carhealth <id> <amount>");
if(!IsPlayerConnected(pid)) return SCM(playerid,COLOR_RED,"ERROR: That player is not connected!");
GPN(pid, pidn, MAX_PLAYER_NAME);
FT(str, sizeof(str), "[CAR]:You have set %s's Car Health to %i!", pidn, amount);
SCM(playerid, NICE_PINK, str);
SetVehicleHealth(ch, amount);
return 1;
}
C:\Users\George\Desktop\SAMP Server\filterscripts\cmds.pwn(788) : error 035: argument type mismatch (argument 1)
CMD:carhealth(playerid,params)
{
new pid, ch = GetPlayerVehicleID(playerid), str[128], pidn[MAX_PLAYER_NAME], Float:amount;
if(!IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_RED,"ERROR: You must be an RCON to use this command!");
if(sscanf(params,"uf", pid, amount)) return SCM(playerid,COLOR_RED,"USAGE: /carhealth <id> <amount>");
if(!IsPlayerConnected(pid)) return SCM(playerid,COLOR_RED,"ERROR: That player is not connected!");
GPN(pid, pidn, MAX_PLAYER_NAME);
FT(str, sizeof(str), "[CAR]:You have set %s's Car Health to %f!", pidn, amount);
SCM(playerid, NICE_PINK, str);
SetVehicleHealth(ch, amount);
return 1;
}
"amount" must be a float.
pawn Код:
|
CMD:carhealth(playerid, params[])
{
new string[128], id, Float:amount, name[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You must be an RCON to use this command!");
if(sscanf(params, "uf", id, amount)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /carhealth <id> <amount>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is not connected!");
GetPlayerName(id, name, sizeof(name));
format(string, sizeof(string), "[CAR]:You have set %s's Car Health to %f!", name, amount);
SendClientMessage(playerid, COLOR_RED, string);
SetVehicleHealth(GetPlayerVehicleID(playerid), amount);
return 1;
}
CMD:carhealth(playerid, params[])
if(sscanf(params,"uf", pid, amount)) return SCM(playerid,COLOR_RED,"USAGE: /carhealth <id> <amount>");
Post was updated.. I made it with my command processor, and it has different parameters. It should work now..
|