21.02.2012, 17:06
So i got this script the problem is:
1. Sometimes the car owner cannot IN the car
2. Sometimes the reg players who doesnt got cars can IN
i want to solevd those problem Only car owner can in any time and no oneeles can be IN
the script :
the text in it Is Hebrew it doesnt matter*****
1. Sometimes the car owner cannot IN the car
2. Sometimes the reg players who doesnt got cars can IN
i want to solevd those problem Only car owner can in any time and no oneeles can be IN
the script :
the text in it Is Hebrew it doesnt matter*****
PHP код:
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
new msg[256];
new file[256];
format(file,sizeof(file),"Car/car%d.txt",GetPlayerVehicleID(playerid));
if(dini_Int(file,"CarOwned") == 1 && dini_Int(file,"Buyable") == 2 && strcmp(dini_Get(file,"CarOwner"),playername,true))
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z+1.2);
}
else
{
if(dini_Int(file,"Buyable") == 2 && dini_Int(file,"CarOwned") == 1)
{
if(strcmp(playername,dini_Get(file,"CarOwner"),true) == 0)
{
format(msg,sizeof(msg),"[%s]ברוך הבא לרכבך המיוחד מסוג",GetVehicleName(vehicleid));
SendClientMessage(playerid,0xFF4500FF,msg);
format(msg,sizeof(msg),"[/Car] לראות את אודות הרכב",GetVehicleName(vehicleid));
SendClientMessage(playerid,0xFF4500FF,msg);
format(msg,sizeof(msg),"/Speedo כדי להוציא את הספידו מטר",GetVehicleName(vehicleid));
SendClientMessage(playerid,0xFF4500FF,msg);
}
else
{
format(msg,sizeof(msg),"[%s]נכנסתה לרכב מיוחד מסוג",GetVehicleName(vehicleid));
SendClientMessage(playerid,0xFF4500FF,msg);
format(msg,sizeof(msg),"[/Car] לראות את אודות הרכב",GetVehicleName(vehicleid));
SendClientMessage(playerid,0xFF4500FF,msg);
format(msg,sizeof(msg),"/Speedo כדי להוציא את הספידו מטר",GetVehicleName(vehicleid));
SendClientMessage(playerid,0xFF4500FF,msg);
}
return 1;
}
if(dini_Int(file,"CarOwned") == 1)
{
if(strcmp(playername,dini_Get(file,"CarOwner"),true) == 0)
{
format(msg,sizeof(msg),"[%s]ברוך הבא לרכבך הרגיל מסוג",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x6495EDFF,msg);
format(msg,sizeof(msg),"[/Car] לראות את אודות הרכב",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x6495EDFF,msg);
format(msg,sizeof(msg),"/Speedo כדי להוציא את הספידו מטר",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x6495EDFF,msg);
}
else
{
format(msg,sizeof(msg),"[%s]נכנסתה לרכב רגיל מסוג",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x6495EDFF,msg);
format(msg,sizeof(msg),"[/Car] לראות את אודות הרכב",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x6495EDFF,msg);
format(msg,sizeof(msg),"/Speedo כדי להוציא את הספידו מטר",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x6495EDFF,msg);
}
}
if(dini_Int(file,"Buyable") == 0)
{
format(msg,sizeof(msg),"[%s]נכנסתה לרכב ציבורי מסוג",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x8B0000FF,msg);
format(msg,sizeof(msg),"[/Car] לראות את אודות הרכב",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x8B0000FF,msg);
format(msg,sizeof(msg),"/Speedo כדי להוציא את הספידו מטר",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x8B0000FF,msg);
}
else if(dini_Int(file,"Buyable") == -1)
{
if(strcmp(playername,dini_Get(file,"CarOwner"),true) == 0) {
format(msg,sizeof(msg),"[%s]נכנסתה לרכב מפקדה מסוג",GetVehicleName(vehicleid));
SendClientMessage(playerid,COLOR_KRED,msg);
format(msg,sizeof(msg),"[/Car] לראות את אודות הרכב",GetVehicleName(vehicleid));
SendClientMessage(playerid,COLOR_KRED,msg);
format(msg,sizeof(msg),"/Speedo כדי להוציא את הספידו מטר",GetVehicleName(vehicleid));
SendClientMessage(playerid,COLOR_KRED,msg);
}
else if(dini_Int(file,"Buyable") == 2)
{
format(msg,sizeof(msg),"[%s]נכנסתה לרכב מיוחד הפנוי לרכישה מסוג",GetVehicleName(vehicleid));
SendClientMessage(playerid,0xFF4500FF,msg);
format(msg,sizeof(msg),"/buycar[1-2] או קנייתו [/Car] לראות את אודות הרכב",GetVehicleName(vehicleid));
SendClientMessage(playerid,0xFF4500FF,msg);
format(msg,sizeof(msg),"/Speedo כדי להוציא את הספידו מטר",GetVehicleName(vehicleid));
SendClientMessage(playerid,0xFF4500FF,msg);
return 1;
}
else
{
format(msg,sizeof(msg),"[%s]נכנסתה לרכב רגיל הפנוי לרכישה מסוג",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x6495EDFF,msg);
format(msg,sizeof(msg),"/buycar[1-2] או קנייתו [/Car] לראות את אודות הרכב",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x6495EDFF,msg);
format(msg,sizeof(msg),"/Speedo כדי להוציא את הספידו מטר",GetVehicleName(vehicleid));
SendClientMessage(playerid,0x6495EDFF,msg);
}
}
}
}
return 1;
}