Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=====================================================================================
- /* FS created by Vegas. 20.11.2012
- You can:
- - Make objects.
- - Make object for player. (SetPlayerAttachedObject)
- - Make labels.
- - Make pickups.
- - Make checkpoints.
- */
- //=====================================================================================
- #include <a_samp>
- #include <streamer>
- #include <zcmd>
- #include <sscanf2>
- //=============================================
- #define SCM SendClientMessage
- //=============================================
- new editing[MAX_PLAYERS];
- new LogStr[256];
- new obc;
- new Float:x,Float:y,Float:z;
- new lol;
- CMD:makeobject(playerid, params[])
- {
- new obj, str[128];
- if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
- if(sscanf(params, "i", obj)) return SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makeobject [objectid]");
- format(str, sizeof(str), "{80FF00}You are editing object %d.", obj);
- SCM(playerid, -1, str);
- GetPlayerPos(playerid, x,y,z);
- obc = CreateObject(obj, x, y, z, 0, 0, 0);
- EditObject(playerid, obc);
- editing[playerid] = 1;
- obj = lol;
- return 1;
- }
- CMD:makepickup(playerid, params[])
- {
- new id, tip, vw, str[128];
- if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
- if(sscanf(params, "iii", id, tip, vw))
- {
- SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makepickup [id] [type] [virtual world]");
- SCM(playerid, -1, "{00FFFF}You can see pickups id at http://wiki.sa-mp.com/wiki/Pickup_IDs");
- SCM(playerid, -1, "{00FFFF}You can see pickups type at http://wiki.sa-mp.com/wiki/PickupTypes");
- return 1;
- }
- GetPlayerPos(playerid, x,y,z);
- AddStaticPickup(id, tip, x, y, z, vw);
- format(str, sizeof(str), "{80FF00}You made an pickup. ID: %d -- Type: %d -- VW: %d", id, tip, vw);
- SCM(playerid, -1, str);
- format(LogStr, sizeof(LogStr), "AddStaticPickup(%d, %d, %f, %f, %f, %d);\r\n", id, tip, x, y, z, vw);
- Pickup(LogStr);
- return 1;
- }
- CMD:makelabel(playerid, params[])
- {
- new txt[40],col, draw, vw, str[128];
- if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
- if(sscanf(params, "s[40]iiii", txt, col, draw, vw)) return SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makelabel [labelid] [col] [distance] [vw]");
- GetPlayerPos(playerid, x,y,z);
- Create3DTextLabel(txt, col, x, y, z, draw, vw, 1);
- format(str, sizeof(str), "{80FF00}You made an label. Text: %s -- Distance: %d -- VW: %d", txt, draw, vw);
- SCM(playerid, -1, str);
- format(LogStr, sizeof(LogStr), "Create3DTextLabel('%s', %d, %f, %f, %f, %d, %d, 1);\r\n", txt, col, x, y, z, draw, vw);
- Label(LogStr);
- return 1;
- }
- CMD:makeplayerobject(playerid, params[])
- {
- new str[128], obcs, bone;
- if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
- if(sscanf(params, "ii", obcs, bone)) return SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makeplayerobject [objectid] [bone]");
- SetPlayerAttachedObject(playerid, 0, obcs, 1);
- EditAttachedObject(playerid,0);
- editing[playerid] = 2;
- format(str, sizeof(str), "{80FF00}You are editing object %d with %d bone", obcs, bone);
- SCM(playerid, -1, str);
- return 1;
- }
- CMD:makecp(playerid, params[])
- {
- new str[128], rng;
- if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{FF0000}You need to be an rcon admin.");
- if(sscanf(params, "i", rng)) return SCM(playerid, -1, "{00FFFF}>> USAGE: {FFFFFF}/makecp [range]");
- GetPlayerPos(playerid, x,y,z);
- SetPlayerCheckpoint(playerid, x,y,z, rng);
- format(str, sizeof(str), "{80FF00}You made an checkpoint with range %d", rng);
- SCM(playerid, -1, str);
- format(LogStr, sizeof(LogStr), "SetPlayerCheckpoint(playerid, %f,%f,%f, %d);\r\n", x,y,z,rng);
- Label(LogStr);
- return 1;
- }
- forward Object(string[]);
- public Object(string[])
- {
- new entry[128];
- format(entry, sizeof(entry), "%s\n",string);
- new File:hFile;
- hFile = fopen("MGK_FS/Object.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- }
- forward Pickup(string[]);
- public Pickup(string[])
- {
- new entry[128];
- format(entry, sizeof(entry), "%s\n",string);
- new File:hFile;
- hFile = fopen("MGK_FS/Pickup.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- }
- forward Label(string[]);
- public Label(string[])
- {
- new entry[128];
- format(entry, sizeof(entry), "%s\n",string);
- new File:hFile;
- hFile = fopen("MGK_FS/Label.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- }
- forward Attach(string[]);
- public Attach(string[])
- {
- new entry[128];
- format(entry, sizeof(entry), "%s\n",string);
- new File:hFile;
- hFile = fopen("MGK_FS/Attach.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- }
- forward CheckP(string[]);
- public CheckP(string[])
- {
- new entry[128];
- format(entry, sizeof(entry), "%s\n",string);
- new File:hFile;
- hFile = fopen("MGK_FS/CPs.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- }
- public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
- {
- if(editing[playerid] == 1)
- {
- editing[playerid] = 0;
- CreateObject(objectid, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ);
- format(LogStr, sizeof(LogStr), "CreateObject(%d,%f,%f,%f,%f,%f,%f);\n", lol, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ);
- Object(LogStr);
- }
- }
- public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
- {
- if(editing[playerid] == 2)
- {
- SetPlayerAttachedObject(playerid,index,modelid,boneid,Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ);
- format(LogStr, sizeof(LogStr), "SetPlayerAttachedObject(playerid,index,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f);\r\n",modelid,boneid,Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ);
- Attach(LogStr);
- editing[playerid] = 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement