Making Car system.. Need som help..!
#1

Okey! Hello! I'm making a car ownership system.. And I'm geting som errors now that i cant solv! I have tryed many hours now!! Can't get the errors away!!!
Here is the script:
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	new carid[256];
	format(carid, 256, "%d", vehicleid);
	new car_name = dini_Int(carid, "name");

	if(dini_Exists(carid))
	{
	new plname[MAX_PLAYER_NAME];
	GetPlayerName(playerid, plname, sizeof(plname));
	if(strcmp(plname, car_name, true) == 0)
 	{
 	SendClientMessage(playerid, COLOR_YELLOW, "Welcome back! Type /stats for status off the car.");
 	{
 	else
  {
    
  }
 	}
 	else
 	{
	SendClientMessage(playerid, COLOR_YELLOW, "This car is for sale! Type /buycar for buy it.");
 	}

	return 1;
}
The error is from the way i try to get playername!
Really need help with this one.. What ever i do, i get error!
Reply
#2

What are the errors?
Reply
#3

You should try post the errors?
Reply
#4

Try this.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  new carid[256];
  format(carid, 256, "%d", vehicleid);
  new car_name = dini_Int(carid, "name");

  if(dini_Exists(carid))
  {
    new plname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plname, sizeof(plname));
    if(strcmp(plname, car_name, true) == 0)
    {
      SendClientMessage(playerid, COLOR_YELLOW, "Welcome back! Type /stats for status off the car.");
    }
    else
    {
      //
    }
  }
  else
  {
    SendClientMessage(playerid, COLOR_YELLOW, "This car is for sale! Type /buycar for buy it.");
  }
  return 1;
}
Reply
#5

Код:
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(247) : error 035: argument type mismatch (argument 2)
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(251) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(256) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(264) : warning 217: loose indentation
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(264) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(264) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(269) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(269) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(269) : error 004: function "OnPlayerStateChange" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(274) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(274) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(274) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(279) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(279) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(279) : error 004: function "OnPlayerLeaveCheckpoint" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(284) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(284) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(284) : error 004: function "OnPlayerEnterRaceCheckpoint" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(289) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(289) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(289) : error 004: function "OnPlayerLeaveRaceCheckpoint" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(294) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(294) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(294) : error 004: function "OnRconCommand" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(299) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(299) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(299) : error 004: function "OnObjectMoved" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(304) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(304) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(304) : error 004: function "OnPlayerObjectMoved" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(309) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(309) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(309) : error 004: function "OnPlayerPickUpPickup" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(314) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(314) : error 029: invalid expression, assumed zero
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(314) : error 004: function "OnPlayerSelectedMenuRow" is not implemented
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(319) : warning 225: unreachable code
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(319) : error 029: invalid expression, assumed zero

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
The error is from where i try to get the Playername!!
Reply
#6

Try my code.
Reply
#7

C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(247) : error 035: argument type mismatch (argument 2)
C:\Users\Daniel Andersen\Desktop\Annet\SAMP\SAMP Server\filterscripts\test.pwn(244) : warning 204: symbol is assigned a value that is never used: "car_name"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

and that is redirecting to which line?
i guess: if(strcmp(plname, car_name, true) == 0)

Correct?
Reply
#9

Yes
Reply
#10

Change
pawn Код:
new car_name;
to
pawn Код:
new car_name[255];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)