/nrg command
#1

how can i create a /nrg command ? but i i want to be inside the nrg when it spawns , just nrg thanks
Reply
#2

pawn Код:
CMD:nrg(playerid, params[])
{
    new Car, Float:x, Float:y, Float:z, Float:k;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, k);
    Car = CreateVehicle(522, x, y, z, k, -1, -1, -1);
    PutPlayerInVehicle(playerid, (Car), 0);
        return 1;
}
Reply
#3

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
pawn Код:
CMD:nrg(playerid, params[])
{
    new Car, Float:x, Float:y, Float:z, Float:k;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, k);
    Car = CreateVehicle(522, x, y, z, k, -1, -1, -1);
    PutPlayerInVehicle(playerid, (Car), 0);
        return 1;
}
Thx +Rep
Reply
#4

pawn Код:
#include <a_samp>
#include <zcmd>
new playerNRG[MAX_PLAYERS] = INVALID_VEHICLE_ID;
public OnPlayerDisconnect(playerid, reason)
{
    if(playerNRG[playerid] != INVALID_VEHICLE_ID)
    {
        DestroyVehicle(playerNRG[playerid]);
        playerNRG[playerid] = INVALID_VEHICLE_ID;
    }
   
    return 1;
}
   
   
CMD:nrg(playerid, params[])
{
    if(GetPlayerVehicleID(playerid)) {
        RemovePlayerFromVehicle(playerid);
    }
   
    if(playerNRG[playerid])
    {
        DestroyVehicle(playerNRG[playerid]);
        playerNRG[playerid] = INVALID_VEHICLE_ID;
    }
   
    new Float: x, Float: y, Float: z;
    GetPlayerPos(playerid, x, y, z);
   
    playerNRG[playerid] = CreateVehicle(522, x, y, z, 0.0, 0, 1, -1);
    if(playerNRG[playerid] != INVALID_VEHICLE_ID) // vehicle was created
    {
        PutPlayerInVehicle(playerid, playerNRG[playerid], 0);
    }
   
    return 1;
}
Reply
#5

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
     if(!
strcmp(cmdtext,"/nrg",true))
     {
     
GetPlayerPos(playerid,Pose[1],Pose[2],Pose[3]);
     
nrg=CreateVehicle(522,Pose[1],Pose[2],Pose[3],0,-1,-1,10);
     
PutPlayerInVehicle(playerid,nrg0);
     
SendClientMessage(playerid,0xFF000000"You have sucessfully spawed a NRG-500. Enjoy!");
     return 
1;
     }
return 
0;

Edit: Too late...Been on Android.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)