SA-MP Forums Archive
Help with Command Text - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with Command Text (/showthread.php?tid=465526)



Help with Command Text - wakeuptomer - 22.09.2013

Hey guys check out my command im ain't know what wrong im really beginner so im trying to learn, so please if you editing and its works tell me what you did ! thanks

Код HTML:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#define COLOR_GOLDENROD 0xDAA520FF

#define FILTERSCRIPT


public OnPlayerCommandText(playerid, cmdtext[])  // basiclly im want when player writing /infernus  he teleporting infernus to his place *position*, and he get client message, "you have been teleported "nfernus" to your position
{
	if (strcmp("/infernus", cmdtext, true, 10) == 0)
	{
	    new Float:x, Float:y, Float:z, Float:a, Infernus;
        GetPlayerPos(playerid,x,y,z);
        GetPlayerFacingAngle(playerid, a);
        Infernus = CreateVehicle(411, x, y, z, a, -1, -1, 60);
        PutPlayerInVehicle(playerid, Infernus, 0);
		new string[19];
        format(string,sizeof(string),"You have been teleported %s to your place",GetPlayerVehicleID(playerid)); //in the string im want to say : You have been teleported "infernus" to your place
		SendClientMessage(playerid,0xDAA520FF,string);
		return 1;
	}
	return 0;
}



Re: Help with Command Text - Konstantinos - 22.09.2013

It's just a message, no need format and get the vehicle id.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/infernus", cmdtext, true))
    {
        new Float:x, Float:y, Float:z, Float:a, Infernus;
        GetPlayerPos(playerid,x,y,z);
        GetPlayerFacingAngle(playerid, a);
        Infernus = CreateVehicle(411, x, y, z, a, -1, -1, 60);
        PutPlayerInVehicle(playerid, Infernus, 0);
        SendClientMessage(playerid,0xDAA520FF,"You have been teleported \"infernus\" to your place");
        return 1;
    }
    return 0;
}



Re: Help with Command Text - wakeuptomer - 22.09.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
It's just a message, no need format and get the vehicle id.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/infernus", cmdtext, true))
    {
        new Float:x, Float:y, Float:z, Float:a, Infernus;
        GetPlayerPos(playerid,x,y,z);
        GetPlayerFacingAngle(playerid, a);
        Infernus = CreateVehicle(411, x, y, z, a, -1, -1, 60);
        PutPlayerInVehicle(playerid, Infernus, 0);
        SendClientMessage(playerid,0xDAA520FF,"You have been teleported \"infernus\" to your place");
        return 1;
    }
    return 0;
}
Thank's, im just wanted to know how to use this string

but i will find some good tutorial really, thank's
GoodNight