Jump to content
  • 0

EDIT: Tot ce inseamna/use Spawn nu functioneaza: /car /jetpack /nrg /v E.T.C.


Question

Posted

Hello ^^

Am o problema cu o comanda :|

Inainte nu functionau comenzile care foloseau SSCANF am bagat SSCANF for 0.3d R2 acuma functioneaza, a mai ramas comanda /car care nu functioneaza de loc!

Scriu comanda /car sultan, apare doar in chat "Sa spawanat vehiculul Sultan Culoare1: n......." dar vehicolul nu se spawneaza xD

Ma poate ajuta careva?

Mai jos veti gasi si comanda /car

Inainte pe 0.3c functiona totul perfect!

[pawn]CMD:car(playerid,params[]) {

    if(IsPlayerInAnyVehicle(playerid)){

    SendClientMessage(playerid,red, "Already drive a car. Out of the car and try again.");

    }

    else

if(PlayerInfo[ playerid ][Level] >= 0) {

    new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);

    if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /car [Modelid/Name] [colour1] [colour2]");

new car, colour1, colour2, string[128];

  if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);

if(car < 400 || car > 611) return  SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model");

if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);

if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);

if(PlayerInfo[ playerid ][pCar] != -1 && !IsPlayerAdmin(playerid) ) CarDeleter(PlayerInfo[ playerid ][pCar]);

new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle);  int1 = GetPlayerInterior(playerid);

LVehicleID = AddStaticVehicleEx(car, X+3,Y,Z, Angle, colour1, colour2, 60); PutPlayerInVehicle(playerid, LVehicleID, 0); LinkVehicleToInterior(LVehicleID,int1);

PlayerInfo[ playerid ][pCar] = LVehicleID;

format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);

        SaveToFile("CarSpawns",string);

format(string, sizeof(string), "{00C0FF}You have spawned a {F81414}\"%s\" {F3FF02}(Model:%d) {00C0FF}colour {B700FF}(%d, %d)", VehicleNames[car-400], car, colour1, colour2);

return SendClientMessage(playerid,lightblue, string);

} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");

return 1;

}[/pawn]

Multumesc frumos celui ce ma va ajuta ^^


F*ck everybody who want and who try to judge me for who I am, b*star*s !

 

 

2 answers to this question

Recommended Posts

Posted

Uite incearca sa pui comanda mea xD:

CMD:car( playerid, params[ ] )
{
    new Car[ 30 ], Color[ 2 ];
	LoginCheck( playerid );
	if ( sscanf( params, "s[30]D(-1)D(-1)", Car, Color[ 0 ], Color[ 1 ] ) ) return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/car [Name/Model] [Color1] [Color2]" );
	if ( IsPlayerInAnyVehicle( playerid ) ) return SendClientMessage( playerid, COLOR_ULTRARED, "ERROR: You are already in a vehicle!" );

    new sCarModel;
	if ( IsNumeric( Car ) )	sCarModel = strval( Car );
	else 					sCarModel = GetVehicleModelIDFromName( Car );
	if ( sCarModel < 400 || sCarModel > 611 ) return SendClientMessage( playerid, COLOR_ULTRARED, "ERROR: Invalid vehicle model/name!" );
	if ( Color[ 0 ] == -1 ) Color[ 0 ] = random( 250 );
	if ( Color[ 1 ] == -1 ) Color[ 1 ] = random( 250 );
    if ( PlayerInfo[ playerid ][ pCar ] != -1 ) CarDeleter( PlayerInfo[ playerid ][ pCar ] );
    
    new Float:cPos[ 4 ], LVehicleID, int1;
    GetPlayerPos( playerid, cPos[ 0 ], cPos[ 1 ], cPos[ 2 ] );
    GetPlayerFacingAngle( playerid, cPos[ 3 ] );
    int1 = GetPlayerInterior( playerid );
    LVehicleID = CreateVehicle( sCarModel, cPos[ 0 ]+3, cPos[ 1 ], cPos[ 2 ], cPos[ 3 ], Color[ 0 ], Color[ 1 ], -1 );
    LinkVehicleToInterior( LVehicleID, int1 );
	SetVehicleNumberPlate( LVehicleID, "{0000BB}R{FFFF00}A{E60000}S" );
    PlayerInfo[ playerid ][ pCar ] = LVehicleID;
	FormatMSG( playerid, COLOR_WHITE, "You have spawned a {FF9900}\"%s\" {E60000}(Model:%d) {FFFFFF}Colour {FF9900}(%d, %d)", vNames[ sCarModel-400 ], sCarModel, Color[ 0 ], Color[ 1 ] );
	return 1;
}

;). Daca iti merge ... las-o pe a mea, mai editezi tu ce nu vrei pe acolo etc.

Fara reclama in semnatura!

Posted

Da Speedy mersi mult, dar acuma am obs. ca problema ii tot ce inseamna SPAWN:

EDIT: TOPIC!

==============

Hello xD

Am o problema pe server.

De cand m-am mutat pe 0.3d numa probleme

Odata o fost cu comenzile care foloseau SSCANF, era problema ca SSCANF nu era pt. 0.3d R2, acuma o aparut SSCANF for 0.3d R2, toate problemele de la comenzile cu SSCANF sau dus.

Acuma am problema cu comenzile care inseamna SPAWN adica:

Toate comenzile care contribuie la SPAWN nu functioneaza adica:

/car /nrg /v /spawn id /jetpack /turismo E.T.C.

Scriu comanda nu se spawneaza accesoriul/vehicolul doar apare TD-ul sau text in Chat ca a fost spawnat bla bla, dar de spawnat sa apara accesoriul/vehicolul nu se intampla.

Am mare nevoie, de cand m-am pus pe 0.3d numa probleme am adica problema asta 8-|

Multumesc mult celui ce ma va ajuta ^^.

======================


F*ck everybody who want and who try to judge me for who I am, b*star*s !

 

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.