public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext,"/fb", true)) { new Float:x, Float:y, Float:z; new idcar; idcar = GetVehiclePos(idcar, x, y, z); DestroyVehicle(idcar); GameTextForPlayer(playerid, "Vehicule broyer!", 3500, 1); } }
new idcar = GetPlayerVehicleID(playerid); DestroyVehicle(idcar); GameTextForPlayer(playerid, "Vehicule broyer!", 3500, 1);
try this code
Код:
new idcar = GetPlayerVehicleID(playerid); DestroyVehicle(idcar); GameTextForPlayer(playerid, "Vehicule broyer!", 3500, 1); |
CMD:fb(playerid, params[]) { new v; if(sscanf(params, "i", v)) return SendClientMessage(playerid, -1, "/fb <car id>"); if(!IsValidVehicle(v)) return 1; DestroyVehicle(v); return 1; }
if(!strcmp(cmdtext,"/fb", true)) { new v; if(sscanf(params, "i", v)) return SendClientMessage(playerid, -1, "/fb <car id>"); if(!IsValidVehicle(v)) return 1; DestroyVehicle(v); return 1; }
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext,"/fb", true)) { new v; if(sscanf(params, "i", v)) return SendClientMessage(playerid, -1, "/fb <car id>"); if(!IsValidVehicle(v)) return 1; DestroyVehicle(v); return 1; }
C:\Users\KEVIN\Desktop\My-RP-Life\filterscripts\CasseLegacy.pwn(387) : error 012: invalid function call, not a valid address C:\Users\KEVIN\Desktop\My-RP-Life\filterscripts\CasseLegacy.pwn(387) : error 017: undefined symbol "params" C:\Users\KEVIN\Desktop\My-RP-Life\filterscripts\CasseLegacy.pwn(387) : error 029: invalid expression, assumed zero C:\Users\KEVIN\Desktop\My-RP-Life\filterscripts\CasseLegacy.pwn(387) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
#include <sscanf>
forward sscanf(const data[], const format[], {Float,_}:...);
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext,"/fb", true)) { new v; if(sscanf(params, "i", v)) return SendClientMessage(playerid, -1, "/fb <car id>"); if(!IsValidVehicle(v)) return 1; DestroyVehicle(v); return 1; }
C:\Users\KEVIN\Desktop\My-RP-Life\filterscripts\CasseLegacy.pwn(386) : error 004: function "sscanf" is not implemented Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
forward sscanf(const data[], const format[], {Float,_}:...);
forward s_sscanf(const data[], const format[], {Float,_}:...); //or any other name except existing function
//OnPlayerCommandText
if(strcmp(cmdtext,"/fb", true, 3) == 0 && cmdtext[3] <= ' ') {
if(cmdtext[3] == EOS || cmdtext[4] == EOS) {
return SendClientMessage(playerid, -1, "/fb <car id>");
}
if(DestroyVehicle(strval(cmdtext[4])) == 0) {
return SendClientMessage(playerid, -1, "Invalid vehicleid!");
}
return SendClientMessage(playerid, -1, "Vehicle destroyed!");
}
//
if(strcmp(cmdtext, "/hello1", true) == 0) {
return SendClientMessage(playerid, -1, "Hello1");
}
if(strcmp(cmdtext,"/fb", true, 3) == 0 && cmdtext[3] <= ' ') {
if(cmdtext[3] == EOS || cmdtext[4] == EOS) {
return SendClientMessage(playerid, -1, "/fb <car id>");
}
if(DestroyVehicle(strval(cmdtext[4])) == 0) {
return SendClientMessage(playerid, -1, "Invalid vehicleid!");
}
return SendClientMessage(playerid, -1, "Vehicle destroyed!");
}
if(strcmp(cmdtext, "/hello2", true) == 0) {
return SendClientMessage(playerid, -1, "Hello2");
}
if(strcmp(cmdtext,"/fb", true, 3) == 0 && cmdtext[3] <= ' ') { |