Scripting Help please!
#9

is there something wrong with this one? in code there is no error. but when i try to /callmycar its not working


#include <a_samp>

#if defined FILTERSCRIPT

new ad10zcar

public OnFilterScriptInit()
{
ad10zcar = AddStaticVehicle(562,1491.7544,-693.4974,94.4110,229.1021,31,97);
AddVehicleComponent(ad10zcar, 1037);
AddVehicleComponent(ad10zcar, 1079);
AddVehicleCompoennt(ad10zcar, 114;
AddVehicleComponent(ad10zcar, 1172);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(GetPlayerVehicleID(playerid) == ad10zcar && strfind(name(playerid), "[USD]Ad10z[Du]", true) == -1)
{
new Float:X,Float:Y,Float:Z;
SendClientMessage(playerid, COLOR_RED, "You can't drive this car!!");
SetPlayerPos(playerid, X,Y,Z+5);
}
}
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/callmycar", true))
if(isReserved[playerid] == 1)
{
new Float:X,Float:Y,Float:Z, name[MAX_PLAYER_NAME];
if(strfind(name(playerid), "[USD]Ad10z[Du]", true) != -1)
{
GetPlayerPos(playerid, X,Y,Z);
SetVehiclePos(ad10zcar, X+3, Y+3, Z);
}
}
else return SendClientMessage(playerid, COLOR_RED, "Your name isn't on the reserved list.");
return 1;
}
public OnPlayerConnect(playerid)
{
if(strfind(name(playerid), "[USD]Ad10z[Du]", true) != -1)
{
isReserved[playerid] = 1;
}
else isReserved[playerid] = 0;
}
#endif
Reply


Messages In This Thread
Scripting Help please! - by adios1 - 08.12.2011, 10:53
Re: Scripting Help please! - by [ABK]Antonio - 08.12.2011, 11:10
Re: Scripting Help please! - by adios1 - 08.12.2011, 11:19
Re: Scripting Help please! - by adios1 - 08.12.2011, 11:27
Re: Scripting Help please! - by [ABK]Antonio - 08.12.2011, 11:30
Re: Scripting Help please! - by adios1 - 08.12.2011, 11:32
Re: Scripting Help please! - by [ABK]Antonio - 08.12.2011, 11:33
Re: Scripting Help please! - by adios1 - 08.12.2011, 11:40
Re: Scripting Help please! - by adios1 - 08.12.2011, 12:03
Re: Scripting Help please! - by Rob_Maate - 08.12.2011, 12:07

Forum Jump:


Users browsing this thread: 3 Guest(s)