CMD:pickup(playerid, params[]) { if(IsPlayerConnected(playerid)) { new Float:x, Float:y, Float:z; new message[128]; new pickupid; if(sscanf(params, "u", pickupid)) return SendClientMessage(playerid, 0x00FF00AA, "USAGE: /pickup [Pickup ID]"); format(message, sizeof(message), "AdmCmd: %s has created a minigun pickup", ReturnPlayerName(playerid)); SendClientMessageToAll(0x00FF00AA, message); GetPlayerPos(playerid, x, y, z); CreatePickup(pickupid, 1, x, y, z); } return 1; }
CMD:pickup(playerid, params[])
{
new Float:x, Float:y, Float:z;
new message[128];
new pickupid;
if(sscanf(params, "i", pickupid)) return SendClientMessage(playerid, 0x00FF00AA, "USAGE: /pickup [Pickup ID]");
format(message, sizeof(message), "AdmCmd: %s has created a minigun pickup", ReturnPlayerName(playerid));
SendClientMessageToAll(0x00FF00AA, message);
GetPlayerPos(playerid, x, y, z);
CreatePickup(pickupid, 19, x, y, z);
return 1;
}
pawn Code:
|
new PickupModelNames[][] = {
{"dildo1", 321},
{"dildo2", 322},
{"vibrator1", 323},
{"vibrator2", 324},
{"flowers", 325},
{"knuckles", 331},
{"golfclub", 333},
{"nitestick", 334},
{"knife", 335},
{"bat", 336},
{"shovel", 337},
{"cue", 338},
{"katana", 339},
{"chainsaw", 341},
{"grenade", 342},
{"teargas", 343},
{"molotov", 344},
{"pistol", 346},
{"sdpistol", 347},
{"deagle", 348},
{"shotgun", 349},
{"sawnoff", 350},
{"spas12", 351},
{"uzi", 352},
{"mp5", 353},
{"ak47", 355},
{"m4", 356},
{"rifle", 357},
{"sniper", 358},
{"rocketlauncher", 359},
{"hsrocketlauncher", 360},
{"flamethrower", 361},
{"minigun", 362},
{"satchel", 363},
{"detonator", 364},
{"spraycan", 365},
{"extinguisher", 366},
{"camera", 367},
{"nightvision", 368},
{"infared", 369},
{"jetpack", 370},
{"parachute", 371},
{"tec9", 372}
};
CMD:pickup(playerid, params[])
{
new pickup[32], message[128];
if(sscanf(params, "s[32]", pickup)) return SendClientMessage(playerid, 0x00FF00AA, "USAGE: /pickup [pickup name]");
new Float:x, Float:y, Float:z;
for(new i = 0; i < sizeof PickupModelNames; i++)
{
if(strcmp(pickup, PickupModelNames[i][0], true) || strlen(pickup) != strlen(PickupModelNames[i][0])) continue;
format(message, sizeof(message), "AdmCmd: %s has created a %s pickup.", ReturnPlayerName(playerid), PickupModelNames[i][0]);
SendClientMessageToAll(0x00FF00AA, message);
GetPlayerPos(playerid, x, y, z);
CreatePickup(PickupModelNames[i][1], 2, x, y, z);
return 1;
}
return SendClientMessage(playerid, 0xFF0000, "Invalid pickup name");
}
CMD:pickup(playerid, params[])
{
new pickup[32], message[128];
if(sscanf(params, "s[32]", pickup)) return SendClientMessage(playerid, 0x00FF00AA, "USAGE: /pickup [pickup name]");
new Float:x, Float:y, Float:z;
for(new i = 0; i < sizeof PickupModelNames; i++)
{
new p = PickupModelNames[i][1];
if(strcmp(pickup, PickupModelNames[i][0], true) || strlen(pickup) != strlen(PickupModelNames[i][0])) continue;
format(message, sizeof(message), "AdmCmd: %s has created a %s pickup.", ReturnPlayerName(playerid), PickupModelNames[i][0]);
SendClientMessageToAll(0x00FF00AA, message);
GetPlayerPos(playerid, x, y, z);
break;
}
return p < 321 || p > 373 || p == 329 || p == 332 || p == 340 ?
SendClientMessage(playerid, 0xFF0000, "Invalid pickup name") : CreatePickup(p, 2, x, y, z);
}