Help with command
#4

pawn Код:
CMD:giveweed(playerid,params[])
{
   if(IsPlayerInRangeOfPoint(playerid, 10.0, x,y,z)) //Change to your needs
   {
    if(PlayerInfo[playerid][pJob] == 1)
    {
        new targetid,type,string[128];
        new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name));
        if(sscanf(params, "ud", targetid, type)) return SendClientMessage(playerid, -1, "[Usage]: /giveweed [Part of Name/Player ID] [Amount]");
        if(type > PlayerInfo[playerid][pWeed])return SendClientMessage(playerid,-1,"ERROR: You do not have that much amount of weeds!");
        if(targetid == playerid)return SendClientMessage(playerid,-1,"ERROR: You cannot give drugs to your self!");
        PlayerInfo[playerid][pWeed] -= type;
        PlayerInfo[targetid][pWeed] +=type;
        format(string,sizeof(string),"You have recieved (%d) weeds from %s(%d) ",type,Name,playerid);
        SendClientMessage(targetid,-1,string);
    }
    else
    {
        SendClientMessage(playerid, -1, "you're not a drugdealer.");
    }
   }
    else //If the player isn't in the specified range??
    return 1;
}
Reply


Messages In This Thread
Help with command - by Michael_Cuellar - 16.04.2013, 00:34
Re : Help with command - by DaTa[X] - 16.04.2013, 01:01
Re: Help with command - by Michael_Cuellar - 16.04.2013, 01:27
Re: Help with command - by Neil. - 16.04.2013, 01:32

Forum Jump:


Users browsing this thread: 4 Guest(s)