13.11.2010, 01:36
What I want it to do: Get it to send the client what model (name) car they are in.
Errors i have:
And the argument type mismatch is for the strfind line, it looks for the model of the car, that goes with its name. Its looking for the VehID of the car that the player is in, then it gets the modelID from the VehID it just gave.
error 035: argument type mismatch (argument 2)
Line:
If you are wondering what VehicleNames[i] is :
It goes on for all the vehicles.
Here is the full code:
I have checked the wiki for strfind, but it doesnt help at all.
Thanks : )
Errors i have:
Код:
(32761) : error 035: argument type mismatch (argument 2) (32755) : warning 204: symbol is assigned a value that is never used: "Model"
pawn Код:
new VehiID = GetPlayerVehicleID( playerid );
new Model = GetVehicleModel( VehiID );
Line:
pawn Код:
if(strfind(VehicleNames[i], Model, true) != -1)
pawn Код:
new VehicleNames[ 212 ][] =
{
"400 - Landstalker", "401 - Bravura", "402 - Buffalo", "403 - Linerunner",
Here is the full code:
pawn Код:
new string[ 128 ], Model;
new VehiID = GetPlayerVehicleID( playerid );
new Model = GetVehicleModel( VehiID );//32755
SendClientMessage(playerid, WHITE, "CAR!"); // just to prove that its actually working, and the vehname thing isnt
for(new i; i < sizeof(VehicleNames); i++)
{
if(strfind(VehicleNames[i], Model, true) != -1) //32761
{
format( string, sizeof( string), "%d", VehicleNames[i]);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
Thanks : )