/turismo or similar command
#1

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
*/
Reply
#2

pawn Код:
new Float:x, Float:y, Float:z;
Reply
#3

EDIT ^man above was faster
Reply
#4

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!!!
Reply
#5

Quote:

IF YOU HELP ME, I WILL GIVE REP!!!

Quote:

Posts: 6

How fascinating!
Reply
#6

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.
Reply
#7

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.
Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)