#1

instead of showing me the message that I spawn car gives me a SERVER: unkown command
PHP код:
CMD:spawncarplayeridparams[  ] )
{
    if( 
IsPlayerLoggedplayerid ] == ) return 0; new color];
    if( 
playerVariablesplayerid ][ pAdmin ] < ) return NotAdminplayerid ); new vehicle;
    if( 
sscanfparams"iii"caridcolor], color] ) ) return SendClientMessageplayeridCOLOR_GREY"Use: {FFFFFF}/spawncar <vehicle id> <color one> <color two>" );
    if( !( 
400 <= carid <= 611 ) ) return SendClientMessageplayeridCOLOR_GREY"Invalid vehicle id. (400 - 611)" );
    else if( !( 
<= color] <= 255 && <= color] <= 255 ) ) return SendClientMessageplayeridCOLOR_GREY"Invalid color id. (0 - 255)" );
    else if( 
VehiclesSpawned >= 50 ) return SendClientMessageplayeridCOLOR_GREY"The maximum number of vehicles has been reached." );
    new 
FloatXFloatYFloatZGetPlayerPosplayeridX,Y,);
    
vehicle CreateVehiclecaridX,Y,Z0.0color], color], -);
    
SpawnVehiclevehicle ] = vehicleVehiclesSpawned ++;
    
LinkVehicleToInteriorvehicleGetPlayerInteriorplayerid ) );
    
SetVehicleVirtualWorldvehicleGetPlayerVirtualWorldplayerid ) );
    
PutPlayerInVehicleplayeridvehicle);
    
SendClientMessageplayeridCOLOR_WHITE"You have spawned a %s."VehicleNamesvehicle 400 ] );
    return 
1;

Reply
#2

What help?
Reply
#3

Quote:
Originally Posted by giorgosdim12
Посмотреть сообщение
What help?
read again
Reply
#4

Hello!

Try this:
PHP код:
CMD:spawncar(playerid,params[])
{
    if(
IsPlayerLogged[playerid] == 0)return 0;
    if(
playerVariables[playerid][pAdmin] < 3)return NotAdmin(playerid);
    new 
color[2],vehicle,carid;
    if(
sscanf(params,"iii",carid,color[0],color[1]))return SendClientMessage(playerid,COLOR_GREY,"Use: {FFFFFF}/spawncar <vehicle id> <color one> <color two>");
    if(
400 carid 611)return SendClientMessage(playerid,COLOR_GREY,"Invalid vehicle id. (400 - 611)");
    if(
color[0] > 255 || color[1] > 255)return SendClientMessage(playerid,COLOR_GREY,"Invalid color id. (0 - 255)");
    if(
VehiclesSpawned >= 50)return SendClientMessage(playerid,COLOR_GREY,"The maximum number of vehicles has been reached.");
    new 
Float:X,Float:Y,Float:Z,string[145];
    
GetPlayerPos(playerid,X,Y,Z);
    
vehicle CreateVehicle(carid,X,Y,Z,0.0,color[0],color[1],-1);
    
SpawnVehicle[vehicle] = vehicle;
    
VehiclesSpawned ++;
    
LinkVehicleToInterior(vehicle,GetPlayerInterior(playerid));
    
SetVehicleVirtualWorld(vehicle,GetPlayerVirtualWorld(playerid));
    
PutPlayerInVehicle(playerid,vehicle,0);
    
format(string,sizeof string,"You have spawned a %s.",VehicleNames[carid-400]);
    
SendClientMessage(playerid,COLOR_WHITE,string);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: