Have problem with privatecars.pwn my own
#1

Reply
#2

Show us some code. You are giving us nothing to work with.

By the way, use [ code ]TEXT[ /code ] (without spaces) for code and errors.
Reply
#3

*looks at his magic ball*

Yeah, still can't guess the code to fix.
Reply
#4

Код:
// PRIVATE CARS SCRIPT MADE BY Wolf_Lv

#include <a_samp>

new privatecar;

public OnFilterScriptInit ()
{
   privatecar = CreateVehicle(400, 0, 0, 0, 0, 1, 1, 86000);
   return 1;
}

 public OnPlayerStateChange(playerid, newstate, oldstate)
 {
	new vehicleid = GetPlayerVehicleID(playerid);
	
	if(newstate == PLAYER_STATE_DRIVER)
	{
		if(vehicleid == privatecar)
		{
			if(strcmp(GetName(playerid), "Wolf_Lv", true)
			{
				return 1;
			}
			else
			{
				RemovePlayerFromVehicle(playerid);
			}
		}
	 }
	 return 1;
 }
 
 stock GetName(playerid)
 {
	 new name[MAX_PLAYER_NAME];
	 GetPlayerName(playerid, name, sizeof name);
	 return name;
 }
Reply
#5

PHP код:
if(strcmp(GetName(playerid), "Wolf_Lv"true//look
if(strcmp(GetName(playerid), "Wolf_Lv"true)) 
Reply
#6

Need make it or replace it?
Reply
#7

replace

PHP код:
if(strcmp(GetName(playerid), "Wolf_Lv"true//error
if(strcmp(GetName(playerid), "Wolf_Lv"true)) //ok 
you see a mistake or not ?
Reply
#8

Thank you, worked
Reply
#9

The function you are using will remove the player from the vehicle if the name is Wolf_Lv, and will let the player enter if the name is different from Wolf_Lv,
You should use this one instead:

PHP код:
if(!strcmp(GetName(playerid), "Wolf_Lv"true)) 
Reply
#10

Quote:
Originally Posted by thefirestate
Посмотреть сообщение
The function you are using will remove the player from the vehicle if the name is Wolf_Lv, and will let the player enter if the name is different from Wolf_Lv,
You should use this one instead:

PHP код:
if(!strcmp(GetName(playerid), "Wolf_Lv"true)) 
Also, the ignorecase parameter should be false, because another player with nickname WOLF_LV could drive the car also.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)