Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*----------------------------------------------------------------------------*\
- ==============================
- system_items.p
- ==============================
- Descrição: Sistema base do jogador, contém comandos e coisas básicas em si.
- Declaração de callbacks: item_
- Declaração de respostas: r@
- Declaração de váriaveis: item_
- Dynamic Roleplay - BlueX (c)
- \*----------------------------------------------------------------------------*/
- #include <bcmd>
- new item_actual_id = -1;
- //debug
- /*
- enum {
- ITEM_MODEL_TELEVISION = 2312,
- ITEM_MODEL_WASHER = 1208,
- ITEM_MODEL_SAFE = 1829,
- ITEM_MODEL_DEAGLE = 348,
- ITEM_MODEL_M4 = 356,
- ITEM_MODEL_AMMO = 1477,
- ITEM_MODEL_BULLETS = 2061
- };
- */
- isbullet(model){
- if(model == 1477 || model == 2061) return 1;
- return 0;
- }
- getweapon(model){
- if(model == 348) return 24;
- else if(model == 356) return 31;
- return 0;
- }
- isweapon(model){
- if(model == 348 && model == 356) return 1;
- return 0;
- }
- getobject(model){
- static _string[30];
- if(model == 2312)
- strins(_string,"ITEM_MODEL_TELEVISION",0);
- else if(model == 1208)
- strins(_string,"ITEM_MODEL_WASHER",0);
- else if(model == 1829)
- strins(_string,"ITEM_MODEL_SAFE",0);
- else if(model == 348)
- strins(_string,"ITEM_MODEL_DEAGLE",0);
- else if(model == 356)
- strins(_string,"ITEM_MODEL_M4",0);
- else if(model == 1477)
- strins(_string,"ITEM_MODEL_AMMO",0);
- else if(model == 2061)
- strins(_string,"ITEM_MODEL_BULLETS",0);
- return _string;
- }
- item_CreateItem(playerid,model,Float:X,Float:Y,Float:Z,Float:rX,Float:rY,Float:rZ){
- item_actual_id ++;
- gItemInfo[item_actual_id][item_x] = X;gItemInfo[item_actual_id][item_y] = Y;gItemInfo[item_actual_id][item_y] = Y;
- gItemInfo[item_actual_id][item_rx] = rX;gItemInfo[item_actual_id][item_rx] = rY;gItemInfo[item_actual_id][item_rz] = rZ;
- gItemInfo[item_actual_id][item_id] = CreateObject(model, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ);
- format(gResult,sizeof(gResult),"[DEBUG]: Object model: %s",getobject(model));
- SendClientMessage(playerid,-1,gResult);
- EditObject(playerid,gItemInfo[item_actual_id][item_id]);
- return 1;
- }
- /*item_GiveItem(playerid,itemid){
- }*/
- IsPlayerInObject(playerid,&id){
- print("pegar");
- for(new i; i<C_MAX_ITEMS; ++i){
- if(IsPlayerInRangeOfPoint(playerid,5.0,gItemInfo[i][item_x],gItemInfo[i][item_y],gItemInfo[i][item_z])){
- id = i;
- return 1;
- }
- }
- return 0;
- }
- cmd(item:playerid,params[],help){
- if(help)
- return SendClientMessage(playerid,-1,"Este comando é um debug.");
- if(isnull(params))
- return SendClientMessage(playerid,-1,"USE: /item [modelid]");
- static Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- item_CreateItem(playerid,strval(params),x+1.0,y+1.0,z,0,0,0);
- return 1;
- }
- cmd(pegar:playerid,params[],help){
- static tid;
- if(IsPlayerInObject(playerid,tid)){
- print("lal");
- if(isweapon(gItemInfo[tid][item_model])){
- GivePlayerWeapon(playerid,getweapon(gItemInfo[tid][item_model]),1);
- }
- if(isbullet(gItemInfo[tid][item_model])){
- player_bullets[playerid] += gItemInfo[tid][item_quantity];
- SendClientMessage(playerid,-1,"Você apanhou balas, use /carregar e coloque a arma.");
- }
- if(!isweapon(gItemInfo[tid][item_model]) && !isbullet(gItemInfo[tid][item_model])){
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_CARRY);
- }
- }
- return 1;
- }
- cmd(carregar:playerid,params[],help){
- if(isnull(params))
- SendClientMessage(playerid,-1,"USE: /carregar [quantidade]");
- if(strval(params) > player_bullets[playerid])
- SendClientMessage(playerid,-1,"Não coloque mais balas do que tem!");
- if(GetPlayerWeapon(playerid) == 24 || GetPlayerWeapon(playerid) == 31){
- SetPlayerAmmo(playerid,GetPlayerWeapon(playerid),strval(params));
- player_bullets[playerid] -= strval(params);
- }
- else
- SendClientMessage(playerid,-1,"Coloque as armas.");
- return 1;
- }
- cmd(stopanim:playerid,params[],help){
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment