Author Topic: Need some help with strcmp.  (Read 2379 times)

0 Members and 1 Guest are viewing this topic.

Offline Jancis_LV

  • Street Thug
  • *
  • Posts: 37
    • View Profile
    • Latvian Vice City
Need some help with strcmp.
« on: February 08, 2010, 06:01:11 pm »
Code: [Select]
kteam = GetPlayerTeam(killerid);
pteam = GetPlayerTeam(playerid);

Code: [Select]
  if(strcmp(kteam,pteam, true ) == 0 ) {
// Do stuff

}

Where is problem?

error 035: argument type mismatch (argument 1)
Latvian Vice City server
78.84.47.75:5192

Offline Boss

  • VC:MP Beta Tester (inactive)
  • Made Man
  • *
  • Posts: 229
  • Boss
    • View Profile
    • TDH Clan Site
Re: Need some help with strcmp.
« Reply #1 on: February 08, 2010, 06:08:21 pm »
Code: [Select]
kteam = GetPlayerTeam(killerid);
pteam = GetPlayerTeam(playerid);

Code: [Select]
  if(strcmp(kteam,pteam, true ) == 0 ) {
// Do stuff

}

Where is problem?

error 035: argument type mismatch (argument 1)
You are doing it WRONG.

Strcmp is used for string comparison only. To compare two numbers just use if(kteam==pteam){}.

Offline Jancis_LV

  • Street Thug
  • *
  • Posts: 37
    • View Profile
    • Latvian Vice City
Re: Need some help with strcmp.
« Reply #2 on: February 08, 2010, 08:15:56 pm »
Thanks, Boss.
Latvian Vice City server
78.84.47.75:5192