STRFIND issues
#1

What I want it to do: Get it to send the client what model (name) car they are in.

Errors i have:
Код:
(32761) : error 035: argument type mismatch (argument 2)
(32755) : warning 204: symbol is assigned a value that is never used: "Model"
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.
pawn Код:
new VehiID = GetPlayerVehicleID( playerid );       
new Model = GetVehicleModel( VehiID );
error 035: argument type mismatch (argument 2)
Line:
pawn Код:
if(strfind(VehicleNames[i], Model, true) != -1)
If you are wondering what VehicleNames[i] is :
pawn Код:
new VehicleNames[ 212 ][] =
{
    "400 - Landstalker",   "401 - Bravura",   "402 - Buffalo",   "403 - Linerunner",
It goes on for all the vehicles.


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);
            }
        }
I have checked the wiki for strfind, but it doesnt help at all.
Thanks : )
Reply


Messages In This Thread
STRFIND issues - by Hal - 13.11.2010, 01:36
Re: STRFIND issues - by Hal - 13.11.2010, 01:53
Re: STRFIND issues - by Hal - 13.11.2010, 01:59
Re: STRFIND issues - by Hal - 13.11.2010, 02:15
Re: STRFIND issues - by Buzzbomb - 13.11.2010, 02:20

Forum Jump:


Users browsing this thread: 1 Guest(s)