Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <YSI\y_commands>
- #include <YSI\y_master>
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- public OnFilterScriptInit()
- {
- AddStaticVehicle(579, 2043.7872, 1343.8685, 10.6719, 285.0782, 0, 1);
- ycmd("rigbomb");
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- forward ycmd_rigbomb(playerid, params[]);
- YCMD:rigbomb(playerid, params[])
- {
- new string1[30], string2[30], idx;
- format(string1, 30, strtok(params, idx));
- format(string2, 30, strtok(params, idx));
- if(strcmp(params, "help", true) == 0)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "|------------------BOMB USAGE------------------|");
- SendClientMessage(playerid, 0xFFFFFFFF, " Timer bomb: /rigbomb timer [seconds]");
- SendClientMessage(playerid, 0xFFFFFFFF, " Remote bomb: /rigbomb remote [plant/detonate]");
- SendClientMessage(playerid, 0xFFFFFFFF, " Speed bomb: /rigbomb speed [speed threshold]");
- SendClientMessage(playerid, 0xFFFFFFFF, " SMS bomb: /rigbomb SMS [plant/detonate]");
- SendClientMessage(playerid, 0xFFFFFFFF, " Chemical bomb: /rigbomb chemical [plant/detonate]");
- SendClientMessage(playerid, 0xFFFFFFFF, "|----------------------------------------------|");
- }
- if(!IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, 0xFF0000AA,"You need to be inside a vehicle to use this command.");
- return 1;
- }
- if(strcmp(params, "timer", true) == 0)
- {
- SendClientMessage(playerid, 0xFF0000AA,"YCMD Confirmation: Timer");
- return 1;
- }
- if(strcmp(params, "remote", true) == 0)
- {
- SendClientMessage(playerid, 0xFF0000AA,"YCMD Confirmation: Remote");
- if(strcmp(string2, "plant", true, 5) == 0)
- {
- SendClientMessage(playerid, 0xFF0000AA,"String confirmation: Plant");
- return 1;
- }
- if(strcmp(string2, "detonate", true, 8) == 0)
- {
- SendClientMessage(playerid, 0xFF0000AA,"String confirmation: Detonate");
- return 1;
- }
- return 1;
- }
- if(strcmp(params, "SMS", true) == 0)
- {
- SendClientMessage(playerid, 0xFF0000AA,"YCMD Confirmation: SMS");
- return 1;
- }
- if(strcmp(params, "chemical", true) == 0)
- {
- SendClientMessage(playerid, 0xFF0000AA,"YCMD Confirmation: Chemical");
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement