How do I convert this to zcmd?
#9

Here you go:

Код:
CMD:kidnap(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000, "You must be in a vehicle to kidnap someone!");
    new KidnapID, PName[MAX_PLAYER_NAME], KidnapString[40];
    if(sscanf(params,"u", KidnapID)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /kidnap [ID]");
    if(!IsPlayerConnected(KidnapID) || IsNumeric(params)) return SendClientMessage(playerid, 0xFF0000, "That's an invalid ID.");
    if(!IsPlayerInVehicle(playerid, GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, 0xFF0000, "That player isn't in your car.");
    if(random(10) == 1)
    {
        SendClientMessage(playerid, 0xFFFF00, "The kidnap was successful.");
        GetPlayerName(playerid, PName, sizeof(PName));
        format(KidnapString, sizeof(KidnapString), "%s has kidnapped you!", PName);
        SendClientMessage(KidnapID, 0xFF0000, KidnapString);
    }
    else
    {
        GetPlayerName(KidnapID, PName, sizeof(PName));
        format(KidnapString, sizeof(KidnapString), "The kidnap failed and %s noticed you tried to kidnap him!", PName);
        SendClientMessage(KidnapID, 0xFF0000, KidnapString);
        GetPlayerName(playerid, PName, sizeof(PName));
        format(KidnapString, sizeof(KidnapString), "%s has attempted to kidnap you!", PName);
        SendClientMessage(KidnapID, 0xFF0000, KidnapString);
    }
    return 1;
}
http://forum.sa-mp.com/showthread.ph...ghlight=sscanf
Reply


Messages In This Thread
How do I convert this to zcmd? - by TheMightyEddy - 12.04.2012, 01:17
Re: How do I convert this to zcmd? - by ReneG - 12.04.2012, 01:20
Re: How do I convert this to zcmd? - by TheMightyEddy - 12.04.2012, 01:26
Re: How do I convert this to zcmd? - by ReneG - 12.04.2012, 01:45
Re: How do I convert this to zcmd? - by TheMightyEddy - 12.04.2012, 02:11
Re: How do I convert this to zcmd? - by TheMightyEddy - 12.04.2012, 02:28
Re: How do I convert this to zcmd? - by ReneG - 12.04.2012, 02:34
Re: How do I convert this to zcmd? - by Shetch - 12.04.2012, 02:45
Re: How do I convert this to zcmd? - by Shetch - 12.04.2012, 02:50
Re: How do I convert this to zcmd? - by TheMightyEddy - 12.04.2012, 02:56

Forum Jump:


Users browsing this thread: 1 Guest(s)