Call Car Script Help! -
TyThaBomb - 21.06.2011
Well, I'm working on making a script to where when you do /rcar, it brings your specific car ID to you. I was thinking you could do the script below. (Just a start) But I'm not sure how to make it to where it brings only a certain car ID for a certain name. Could someone help me? It'd be greatly appreciated! (And yes, I am new-ish to scripting)
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
{
if (strcmp("/rcar", cmdtext, true, 10) == 0)
{
if(strcmp(PlayerName,"Tyler[DGZ]",true)) {
}
return 1;
Respuesta: Call Car Script Help! -
[DOG]irinel1996 - 21.06.2011
If I'm not misunderstood... For example, you put /RCAR 1 and brings the car with the ID 1 to your location?
Re: Call Car Script Help! -
TyThaBomb - 21.06.2011
Not that, I want it to where let's say I do /rcar. I want it to bring car ID ONE to me. Thats why I added the name checker, so it only brings a certain car for a certain name.
Respuesta: Call Car Script Help! -
[DOG]irinel1996 - 21.06.2011
OK. I will make it. Wait 20 minutes.
Re: Call Car Script Help! -
TyThaBomb - 21.06.2011
Sweet!
Respuesta: Call Car Script Help! -
[DOG]irinel1996 - 21.06.2011
Here you have:
pawn Код:
if (strcmp("/rcar", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
if(!strcmp(Name, "Tyler[DGZ]", true)) //Check the Player Name
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetVehiclePos(1, X, Y, Z); //1 = vehicleid. || X = Position X || Y = Position Y || Z = Position Z.
PutPlayerInVehicle(playerid, 1, 0); //1 = vehicleid || 0 = State(0 = Driver)
}
else
{
SendClientMessage(playerid,-1,"You can't use this command!");
return 1;
}
}
return 1;
}
Re: Call Car Script Help! -
TyThaBomb - 21.06.2011
Not compiling for me.. >.<
Respuesta: Call Car Script Help! -
[DOG]irinel1996 - 21.06.2011
What's the error?
It must look like here:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
//Command Start Here
if (strcmp("/rcar", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
if(!strcmp(Name, "Tyler[DGZ]", true)) //Check the Player Name
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetVehiclePos(1, X, Y, Z); //1 = vehicleid. || X = Position X || Y = Position Y || Z = Position Z.
PutPlayerInVehicle(playerid, 1, 0); //1 = vehicleid || 0 = State(0 = Driver)
}
else
{
SendClientMessage(playerid,-1,"You can't use this command!");
return 1;
}
}
return 1;
}
//Command Finish Here
return 0;
}
Re: Call Car Script Help! -
TyThaBomb - 21.06.2011
Okay, fixed the errors, I added it to my server.cfg, and the command /rcar isnt working.
Respuesta: Call Car Script Help! -
[DOG]irinel1996 - 21.06.2011
Try to do as I told you above, and if you can't, send me a private message with your MSN.