[pepsi] Posted November 27, 2011 Posted November 27, 2011 deci asta e comanda de /nrg[table]COMMAND:nrg(playerid, params[]) { new string[256]; if(pNRG[playerid] > 0) { if(GetPlayerVehicleID(playerid) != pNRG[playerid]) { if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid); new Float: X, Float: Y, Float: Z, Float: Ang; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, Ang); SetVehicleVirtualWorld(pNRG[playerid],GetPlayerVirtualWorld(playerid)); PutPlayerInVehicle(playerid, pNRG[playerid], 0); SetVehiclePos(pNRG[playerid], X, Y, Z); SetVehicleZAngle(pNRG[playerid], Ang); SetVehicleHealth(pNRG[playerid], 1000.0); LinkVehicleToInterior(pNRG[playerid], GetPlayerInterior(playerid)); TextDrawShowForPlayer(playerid, MsgNrg); SetTimerEx("Hide", 3500, false, "d", playerid ,string); } else { SendClientMessage(playerid,0xCC0000AA, "{00C0FF}Ai deja un {F81414}NRG-500!"); } } else { if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid); new Float: X, Float: Y, Float: Z, Float: Ang; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, Ang); pNRG[playerid] = CreateVehicle(522, X, Y, Z+3, Ang, 75,3, 5000000); PutPlayerInVehicle(playerid, pNRG[playerid], 0); SetVehicleVirtualWorld(pNRG[playerid],GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(pNRG[playerid], GetPlayerInterior(playerid)); printf("Personal NRG Created For %s.", PlayerName2(playerid)); TextDrawShowForPlayer(playerid, MsgNrg); SetTimerEx("Hide", 3500, false, "d", playerid ,string); for(new i=0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i) && i != playerid) { SetVehicleParamsForPlayer(pNRG[playerid], i, 0, 1); } } } return 1; }[/table] ce ar trebuii sa ii fac sa imi aduca masina privata prin comanda /mycar ?
IstuntmanI Posted November 27, 2011 Posted November 27, 2011 Dublezi comanda /nrg, si o numesti /mycar, schimbi variabila pNRG in pMYCAR (dublezi variabila si o redenumesti asa peste tot in script) si schimbi id-ul vehiculului cu ce vrei tu, de la linia asta:pNRG[playerid] = CreateVehicle(522, X, Y, Z+3, Ang, 75,3, 5000000);Nu se cer scripturi.
Question
[pepsi]
deci asta e comanda de /nrg[table]
COMMAND:nrg(playerid, params[]){
new string[256];
if(pNRG[playerid] > 0)
{
if(GetPlayerVehicleID(playerid) != pNRG[playerid])
{
if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
new Float: X, Float: Y, Float: Z, Float: Ang;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
SetVehicleVirtualWorld(pNRG[playerid],GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, pNRG[playerid], 0);
SetVehiclePos(pNRG[playerid], X, Y, Z);
SetVehicleZAngle(pNRG[playerid], Ang);
SetVehicleHealth(pNRG[playerid], 1000.0);
LinkVehicleToInterior(pNRG[playerid], GetPlayerInterior(playerid));
TextDrawShowForPlayer(playerid, MsgNrg);
SetTimerEx("Hide", 3500, false, "d", playerid ,string);
}
else
{
SendClientMessage(playerid,0xCC0000AA, "{00C0FF}Ai deja un {F81414}NRG-500!");
}
}
else
{
if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
new Float: X, Float: Y, Float: Z, Float: Ang;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
pNRG[playerid] = CreateVehicle(522, X, Y, Z+3, Ang, 75,3, 5000000);
PutPlayerInVehicle(playerid, pNRG[playerid], 0);
SetVehicleVirtualWorld(pNRG[playerid],GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(pNRG[playerid], GetPlayerInterior(playerid));
printf("Personal NRG Created For %s.", PlayerName2(playerid));
TextDrawShowForPlayer(playerid, MsgNrg);
SetTimerEx("Hide", 3500, false, "d", playerid ,string);
for(new i=0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && i != playerid)
{
SetVehicleParamsForPlayer(pNRG[playerid], i, 0, 1);
}
}
}
return 1;
}
[/table] ce ar trebuii sa ii fac sa imi aduca masina privata prin comanda /mycar ?
1 answer to this question
Recommended Posts