Line 347: error 035: argument type mismatch (argument 9)
YCMD:createvehicle(playerid, params[], help) { if(help) return SendClientMessage(playerid, -1, "Allows to create a dynamic vehicle."); new vehModel, vehColor1, vehColor2, vehRespawnTime; if(sscanf(params, "iiii", vehModel, vehColor1, vehColor2, vehRespawnTime)) return SendClientMessage(playerid, -1, "USAGE: /createvehicle [Vehicle Model] [Color 1] [Color 2] [Respawn Time]"); new Float:x, Float:y, Float:z, Float:angle; new strPlayerName[MAX_PLAYER_NAME]; new vehicleid; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, angle); GetPlayerName(playerid, strPlayerName, MAX_PLAYER_NAME); vehicleid = CreateVehicleEx(vehModel, x, y, z, angle, vehColor1, vehColor2, vehRespawnTime, strPlayerName, 160000, true); //line 347. Argument 9 is the strPlayerName(Owner name in the original function) PutPlayerInVehicle(playerid, vehicleid, 0); return 1; }
stock CreateVehicleEx(vehicleModel, Float:vxSpawn, Float:vySpawn, Float:vzSpawn, Float:vangleSpawn, vehicleColor1, vehicleColor2, vehicleRespawn, vehicleOwner, vehiclePrice, bool:vehicleBuyable) { new vehicleid = GetFreeVehicleSlot(); VehicleInfo[vehicleid][vModel] = vehicleModel; VehicleInfo[vehicleid][xSpawn] = vxSpawn; VehicleInfo[vehicleid][ySpawn] = vySpawn; VehicleInfo[vehicleid][zSpawn] = vzSpawn; VehicleInfo[vehicleid][angleSpawn] = vangleSpawn; VehicleInfo[vehicleid][vCol1] = vehicleColor1; VehicleInfo[vehicleid][vCol2] = vehicleColor2; VehicleInfo[vehicleid][vRespawn] = vehicleRespawn, VehicleInfo[vehicleid][vOwner] = vehicleOwner; VehicleInfo[vehicleid][vPrice] = vehiclePrice; VehicleInfo[vehicleid][vBuyable] = vehicleBuyable; VehicleInfo[vehicleid][vID] = CreateVehicle(vehicleModel, vxSpawn, vySpawn, vzSpawn, vangleSpawn, vehicleColor1, vehicleColor2, vehicleRespawn); vCreated[vehicleid] = true; return vehicleid; }
CreateVehicleEx(vehicleModel, Float:vxSpawn, Float:vySpawn, Float:vzSpawn, Float:vangleSpawn, vehicleColor1, vehicleColor2, vehicleRespawn, vehicleOwner[MAX_PLAYER_NAME], vehiclePrice, bool:vehicleBuyable)
{
new vehicleid = GetFreeVehicleSlot();
VehicleInfo[vehicleid][vModel] = vehicleModel;
VehicleInfo[vehicleid][xSpawn] = vxSpawn;
VehicleInfo[vehicleid][ySpawn] = vySpawn;
VehicleInfo[vehicleid][zSpawn] = vzSpawn;
VehicleInfo[vehicleid][angleSpawn] = vangleSpawn;
VehicleInfo[vehicleid][vCol1] = vehicleColor1;
VehicleInfo[vehicleid][vCol2] = vehicleColor2;
VehicleInfo[vehicleid][vRespawn] = vehicleRespawn,
VehicleInfo[vehicleid][vOwner] = vehicleOwner;
VehicleInfo[vehicleid][vPrice] = vehiclePrice;
VehicleInfo[vehicleid][vBuyable] = vehicleBuyable;
VehicleInfo[vehicleid][vID] = CreateVehicle(vehicleModel, vxSpawn, vySpawn, vzSpawn, vangleSpawn, vehicleColor1, vehicleColor2, vehicleRespawn);
vCreated[vehicleid] = true;
return vehicleid;
}
VehicleInfo[vehicleid][vOwner] = vehicleOwner;
format(VehicleInfo[vehicleid][vOwner], MAX_PLAYER_NAME,"%s",vehicleOwner);
Try this:
PHP код:
Код:
VehicleInfo[vehicleid][vOwner] = vehicleOwner; PHP код:
|
stock CreateVehicleEx(vehicleModel, Float:vxSpawn, Float:vySpawn, Float:vzSpawn, Float:vangleSpawn, vehicleColor1, vehicleColor2, vehicleRespawn, vehicleOwner[], vehiclePrice, bool:vehicleBuyable)
Код:
stock CreateVehicleEx(vehicleModel, Float:vxSpawn, Float:vySpawn, Float:vzSpawn, Float:vangleSpawn, vehicleColor1, vehicleColor2, vehicleRespawn, vehicleOwner[], vehiclePrice, bool:vehicleBuyable) |
CreateVehicleEx(vehicleModel, Float:vxSpawn, Float:vySpawn, Float:vzSpawn, Float:vangleSpawn, vehicleColor1, vehicleColor2, vehicleRespawn, vehicleOwner[24], vehiclePrice, bool:vehicleBuyable)
And this one?
PHP код:
|
CreateVehicleEx(vehicleModel, Float:vxSpawn, Float:vySpawn, Float:vzSpawn, Float:vangleSpawn, vehicleColor1, vehicleColor2, vehicleRespawn, vehicleOwner[MAX_PLAYER_NAME], vehiclePrice, bool:vehicleBuyable)
stock CreateVehicleEx(vehicleModel, Float:vxSpawn, Float:vySpawn, Float:vzSpawn, Float:vangleSpawn, vehicleColor1, vehicleColor2, vehicleRespawn, vehicleOwner[], vehiclePrice, bool:vehicleBuyable)
VehicleInfo[vehicleid][vOwner] = vehicleOwner;
#if !defined strcpy
#define strcpy(%0,%1) strcat((%0[0] = EOS, %0), %1)
#endif
strcpy(destination, source, size);
strcpy(VehicleInfo[vehicleid][vOwner], vehicleOwner, MAX_PLAYER_NAME);
vehicleOwner[MAX_PLAYER_NAME],
Keep it as:
pawn Код:
pawn Код:
pawn Код:
pawn Код:
pawn Код:
pawn Код:
|