#define FILTERSCRIPT #include <a_samp> new objectid[3]; new vehicleid[3]; public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/animals", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid, 98123, DIALOG_STYLE_MSGBOX, "Animals", "{FFFFFF}/deer {66FF00}- Spawns Deer \n{FFFFFF}/turtle {66FF00}- Spawns Turtle \n{FFFFFF}/cow {66FF00}- Spawns Cow", "Okay", ""); } if (strcmp("/deer", cmdtext, true, 10) == 0) { new int1 = GetPlayerInterior(playerid); new Float: x, Float: y, Float: z, Float: r, deer; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,r); deer = CreateVehicle(522,x,y,z,r,000,000,0); PutPlayerInVehicle(playerid,deer,0); LinkVehicleToInterior(GetPlayerVehicleID(playerid),int1+1); objectid[0] = CreateObject(19315,0,0,0,0,0,0); vehicleid[0] = GetPlayerVehicleID(playerid); AttachObjectToVehicle(objectid[0], vehicleid[0], 0.0, 0.0, 0.0, 0.0, 0.0, 90.0); SendClientMessage(playerid,0xFFFFFFFF, "{FFFFFF}Animals: {66FF00}Deer {FFFFFF}spawned!"); return 1; } if (strcmp("/turtle", cmdtext, true, 10) == 0) { new int2 = GetPlayerInterior(playerid); new Float: x, Float: y, Float: z, Float: r, turtle; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,r); turtle = CreateVehicle(571,x,y,z,r,000,000,0); PutPlayerInVehicle(playerid,turtle,0); LinkVehicleToInterior(GetPlayerVehicleID(playerid),int2+1); objectid[1] = CreateObject(1609,0,0,0,0,0,0); vehicleid[1] = GetPlayerVehicleID(playerid); AttachObjectToVehicle(objectid[1], vehicleid[1], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); SendClientMessage(playerid,0xFFFFFFFF, "{FFFFFF}Animals: {66FF00}Turtle {FFFFFF}spawned!"); return 1; } if (strcmp("/cow", cmdtext, true, 10) == 0) { new int3 = GetPlayerInterior(playerid); new Float: x, Float: y, Float: z, Float: r, cow; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,r); cow = CreateVehicle(573,x,y,z,r,000,000,0); PutPlayerInVehicle(playerid,cow,0); LinkVehicleToInterior(GetPlayerVehicleID(playerid),int3+1); objectid[2] = CreateObject(16442,0,0,0,0,0,0); vehicleid[2] = GetPlayerVehicleID(playerid); AttachObjectToVehicle(objectid[2], vehicleid[2], 0.0, 0.0, 0.5, 0.0, 0.0, 90.0); SendClientMessage(playerid,0xFFFFFFFF, "{FFFFFF}Animals: {66FF00}Cow {FFFFFF}spawned!"); return 1; } return 1; }
So you didn't post the code, and the only bug is that it doesn't work?
|
So you didn't post the code, and the only bug is that it doesn't work?
EDIT: ^Damn spammer.. Didn't even read the post! |
So you didn't post the code, and the only bug is that it doesn't work?
EDIT: ^Damn spammer.. Didn't even read the post! |
[If you know how to fix please tell me I will add in credits] |
return 1;
// Returning 1 informs the server that the command has been processed.
// OnPlayerCommandText won't be called in other scripts.
}
return 0;
// Returning 0 informs the server that the command hasn't been processed by this script.
// OnPlayerCommandText will be called in other scripts until one returns 1.
// If no scripts return 1, the 'SERVER: Unknown Command' message will be shown to the player.
}
OnPlayerCommandText should return false/0 not true/1. (Refer to the wiki page)
|
oh LOL XD
it's funny... but you got a lot of error there. here some fix from me. |
Well it would've been better if you actually created a real system here. But all you did was attach an object, and set an NRG's virtual world to something other than the players. Not really impressive. Also, can you please provide a pastebin link?
|