// 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;
}
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;
}
It's just a message, no need format and get the vehicle id.
pawn Код:
|