Help with Command Text
#1

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;
}
Reply
#2

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;
}
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)