All pastes #930894 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-06 21:30 UTC
rendered paste body
new Createdobjects[100];
new Createdobject = 0;

if(strcmp(cmd, "/spawnobject", true) == 0)
        {
            if(IsPlayerConnected(playerid))
            {
                if (PlayerInfo[playerid][pAdmin] < 1)
                        {
                            SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
                            return 1;
                        }
                        tmp = strtok(cmdtext, idx);
                        if(!strlen(tmp))
                        {
                                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /spawnobject [objectid]");
                                return 1;
                        }
                        new object;
                        object = strval(tmp);
                        if(object < 615 || object > 18112) { SendClientMessage(playerid, COLOR_GREY, "   Object Number can't be below 615 or above 18112 !"); return 1; }
                        tmp = strtok(cmdtext, idx);
                        if(!strlen(tmp))
						{
			     	SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [objectid 615-18112]");
			    	return 1;
		            	}
                        new Float:X,Float:Y,Float:Z;
                        GetPlayerPos(playerid, X,Y,Z);
                        new objectid = Createobject(object, X,Y,Z, 0.0, 60000);
                        Createdobjects[Createdobject] = objectid;
                        Createdobject ++;
                        new string[64];
                        format(string, sizeof(string), "   object %d spawned.", objectid);
                        SendClientMessage(playerid, COLOR_GREY, string);
] else
                        {
                                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /spawnobject [objectid]");
                                return 1;
                        }
                }
                return 1;
        }