/turismo or similar command -
Karol56 - 06.07.2012
Hi,
The title is the main thing.
I can't figure out how to make a vehicle spawn command on the player's Pos for my test server.
It doesn't have to be a /v command etc as I have a filterscript for that, just a simple command.. like I tried it here:
Код:
if (strcmp("/turismo", cmdtext, true) == 0)
{
new x,y,z;
GetPlayerPos(playerid, x, y, z);
CreateVehicle(251, x, y, z, 0.0, 1, 1, 0);
return 1;
}
/* D:\GTA SA\SAMP Development\Server files\gamemodes\Karols_Stunt_DM.pwn(452) : warning 213: tag mismatch
D:\GTA SA\SAMP Development\Server files\gamemodes\Karols_Stunt_DM.pwn(452) : warning 213: tag mismatch
D:\GTA SA\SAMP Development\Server files\gamemodes\Karols_Stunt_DM.pwn(452) : warning 213: tag mismatch
*/
Re: /turismo or similar command -
newbienoob - 06.07.2012
pawn Код:
new Float:x, Float:y, Float:z;
Re: /turismo or similar command -
Roko_foko - 06.07.2012
EDIT ^man above was faster
Re: /turismo or similar command -
Karol56 - 06.07.2012
Okey, now I have no errors but the command itself doesn't work on my test server. Also a bit off topic, I have a problem with the command /repair.. each time I type a wrong command in, it puts the string as error instead of example: "SERVER: Unknown command".
Here's the code for my current /turismo command:
Код:
if (strcmp("/turismo", cmdtext, true) == 0)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateVehicle(251, x, y, z, 0.0, 1, 1, 0);
return 1;
}
and here's the code for /repair:
if (strcmp("/repair", cmdtext))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You're not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_CYAN, "Your vehicle has been successfully repaired!");
return 1;
}
IF YOU HELP ME, I WILL GIVE REP!!!
Re: /turismo or similar command -
FireCat - 06.07.2012
Quote:
IF YOU HELP ME, I WILL GIVE REP!!!
|
How fascinating!
Re: /turismo or similar command -
Karol56 - 06.07.2012
Quote:
Originally Posted by FireCat
How fascinating!
|
Doesn't everyone love REP? All I can read is "Give rep!!!"
And please don't post here if you aren't gonna help.
Re: /turismo or similar command -
newbienoob - 06.07.2012
pawn Код:
if (strcmp("/turismo", cmdtext, true, 10) == 0)
{
new Float:x, Float:y, Float:z,Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid,a);
CreateVehicle(451, x, y, z, a, -1,-1, -1);//vehicle id = 451, not 251
return 1;
}
if (strcmp("/repair", cmdtext, true, 10) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You're not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, -1, "Your vehicle has been successfully repaired!");
return 1;
}
Btw, you can't give a rep if your post is under 50.
Re: /turismo or similar command -
Karol56 - 06.07.2012
Quote:
Originally Posted by newbienoob
pawn Код:
if (strcmp("/turismo", cmdtext, true, 10) == 0) { new Float:x, Float:y, Float:z,Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid,a); CreateVehicle(451, x, y, z, a, -1,-1, -1);//vehicle id = 451, not 251 return 1; } if (strcmp("/repair", cmdtext, true, 10) == 0) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You're not in a vehicle!"); RepairVehicle(GetPlayerVehicleID(playerid)); SendClientMessage(playerid, -1, "Your vehicle has been successfully repaired!"); return 1; }
Btw, you can't give a rep if your post is under 50.
|
Btw.. I wonder what does the "10" and the 0 mean at the end of each "if (strcmp("/repair", cmdtext, true,
10) ==
0)
And thanks for info + help.