one error
#1

this is wat i made for personal car and for personal gang cars

but it wont compile
1566) : error 035: argument type mismatch (argument 4)

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  new string[100];
  new PlayerName1[24];
  GetPlayerName(playerid, PlayerName1, sizeof(PlayerName1));
  GetPlayerName(playerid, string, MAX_PLAYER_NAME);
  if(newstate == PLAYER_STATE_DRIVER)
  {
   new Vehicle = GetPlayerVehicleID(playerid);
   if(Vehicle == dlegend)
   {
     if(strcmp(PlayerName1,"dlegend",true))
     {
      RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, 0xFB0000FF, "I'm sorry, but this car has been reserved for dlegend");
     }
   }
  }
  if(newstate == PLAYER_STATE_DRIVER)
  {
   new Vehicle = GetPlayerVehicleID(playerid);
   if(Vehicle == dlegend)
   {
1566     if(strcmp(PlayerName1,"[pTc]%d",true,string))
     {
      RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, 0xFB0000FF, "I'm sorry, but this car has been reserved for ptc members");
     }
   }
  }
  return 1;
}}
Reply
#2

Which line is 1566?
Reply
#3

Quote:

1566 if(strcmp(PlayerName1,"[pTc]%d",true,string))

Reply
#4

My thoughts on that are that;

%d is assigned to true.

so just remove the ,string.

and if you're checking for if the player is not that name then,

instead of
pawn Код:
if(strcmp(PlayerName1,"dlegend",true))
you need to do
pawn Код:
if(!strcmp(PlayerName1,"dlegend",true))
note how the ' ! ' is for checking if the persons name is not dlegend.
Reply
#5

but wat i need it to do is have the ptc in there name then the players name so i though it would have to be like that
Reply
#6

Why dont you use format ?
Reply
#7

Quote:
Originally Posted by [NaB
Hiitch - No srsly, Im a NaB ! ]
My thoughts on that are that;

%d is assigned to true.

so just remove the ,string.

and if you're checking for if the player is not that name then,

instead of
pawn Код:
if(strcmp(PlayerName1,"dlegend",true))
you need to do
pawn Код:
if(!strcmp(PlayerName1,"dlegend",true))
note how the ' ! ' is for checking if the persons name is not dlegend.
The ! is to check if they ARE the same. Strcmp returns 0 if the strings you are comparing match.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)