20.07.2016, 19:04
The follow command is giving me "Server: Unkown Command"
Server Logs:
pawn Код:
CMD:givevehicle(playerid,params[])
{
if(pData[playerid][pAdmin] >= 5)
{
new ID, VehicleID,String[150],vColor1,vColor2,query[200];
if(sscanf(params, "uddd", ID,VehicleID,vColor1,vColor2)) return SendClientMessage(playerid, COLOR_GREY,"Usage: /Givepvehicle [Player ID] [Vehicle ID] [Color 1] [Color 2]");
{
new Float:VehiclePos[4],VehiclesID;
format(String, sizeof(String), "AdmCmd: %s was given a %s by Administrator %s.", NewPlayerName(ID), GetVehicleName(VehicleID), NewPlayerName(playerid));
SendAdminMessage(COLOR_LIGHTRED, String);
GetPlayerFacingAngle(playerid, VehiclePos[3]);
if(pData[playerid][pAdmin] > 3 ) { AdminLogs(String); }
VehiclesID = CreateVehicle(VehicleID, VehiclePos[0],VehiclePos[1],VehiclePos[2],VehiclePos[3],vColor1,vColor2,-1);
format(query, sizeof(query), "INSERT INTO vehicles (Owner, Model, Color1,Color2,PosX,PosY,PosZ,PosA,Interior,VirtualWorld) VALUES('%s', %d, %d, %d,'%f','%f','%f','%f',%d,%d)", GetName(ID), VehicleID, vColor1,vColor2,VehiclePos[0],VehiclePos[1],VehiclePos[2],VehiclePos[3],GetPlayerInterior(playerid),GetPlayerVirtualWorld(playerid));
mysql_query(query);
vData[VehiclesID][VehicleColor1] = vColor1;
vData[VehiclesID][VehicleColor1] = vColor2;
vData[VehiclesID][OwnerID] = ID;
vData[VehiclesID][VehicleInterior] = ID;
vData[VehiclesID][VehicleVW] = ID;
vData[VehiclesID][VehicleDID] = CountVehicles();
}
}
else { ReturnError(playerid); }
return 1;
}
Server Logs:
Код:
[15:10:51] [debug] #0 000080bc in GetVehicleName (vehicleid=400) at C:\Users\flemi_000\Desktop\SAMP\gamemodes\testing.pwn:70 [15:10:51] [debug] #1 0000b3ec in public cmd_givevehicle (playerid=0, params[]=@0008fb2c "0 400 0 0") at C:\Users\flemi_000\Desktop\SAMP\gamemodes\testing.pwn:468 [15:10:51] [debug] #2 native CallLocalFunction () from samp-server.exe [15:10:51] [debug] #3 00000684 in public OnPlayerCommandText (playerid=0, cmdtext[]=@0008fad0 "/givevehicle 0 400 0 0") at C:\Users\flemi_000\Desktop\SAMP\pawno\include\zcmd.inc:110