[Solved]1 error in my command
#1

There problem is if i put "GivePlayerMoney(playerid, -8000);" it gives the error. Error name is error 029: invalid expression, assumed zero. Anyone has a idea how to fix it ?

Quote:

if(strcmp(cmd, "/t2", true) == 0 || strcmp(cmd, "/tv2", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
new keyr = PlayerInfo[playerid][pky2];
if(keyr != 999)
{
if(!unwanted[keycar]) SetVehicleToRespawn(keyr);
GivePlayerMoney(playerid, -8000); // gives the error
else SendClientMessage(playerid, COLOR_WHITE, "* vehicle is in use");
}
}
return 1;
}

Reply
#2

Because you've putted it between if and else statement, and you can't do that.
Reply
#3

where i need to put it ? Pls help. Thanks.
Reply
#4

I don't know, you decide where do you want to use it, under if or under else statement.
Reply
#5

Quote:
Originally Posted by Don Correlli
I don't know, you decide where do you want to use it, under if or under else statement.
under if.. if the car respawns money should go. ty for help
Reply
#6

I tried some ways pawno is crashing.. Can somone give a correct code pls ?
Reply
#7

pawn Код:
if(strcmp(cmd, "/t2", true) == 0 || strcmp(cmd, "/tv2", true) == 0)
{
  for(new player = 0; player < GetMaxPlayers(); player++)
  {
    if(IsPlayerInAnyVehicle(player)) unwanted[GetPlayerVehicleID(player)] = true;
  }
  new
      keyr = PlayerInfo[playerid][pky2];
  if(keyr != 999)
  {
    if(!unwanted[keycar])
    {
      SetVehicleToRespawn(keyr);
      GivePlayerMoney(playerid, -8000);
    }
    else SendClientMessage(playerid, COLOR_WHITE, "* vehicle is in use");
  }
  return true;
}
Reply
#8

Thanks Don Correlli it works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)