24.08.2014, 04:49
Quote:
CMD:crearatm(playerid, params[])
{ if(!IsPlayerConnectedEx(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, NoConectado); if(Info[playerid][pAdmin] < 7) return SendClientMessageEx(playerid, COLOR_GREY, "* No puedes usar este comando."); new atmid; if(!sscanf(params, "d", atmid)) { if(atmid < 0 || atmid > MAX_ATMS) return SendClientMessageEx( playerid, COLOR_GREY, "* ID de ATM invбlida."); if(atmVariables[atmid][atmMoney] > 0) return SendClientMessageEx( playerid, COLOR_GREY, "* Esta ID estб siendo utilizada."); GetPlayerPos(playerid, atmVariables[atmid][fATMPos][0], atmVariables[atmid][fATMPos][1], atmVariables[atmid][fATMPos][2]); GetPlayerFacingAngle(playerid, atmVariables[atmid][fATMPosRot]); DestroyDynamicObject(atmVariables[atmid][rObjectId]); atmVariables[atmid][rObjectId] = CreateDynamicObject(2942,atmVariables[atmid][fATMPos][0],atmVariables[atmid][fATMPos][1],atmVariables[atmid][fATMPos][2]-0.4,0,0,atmVariables[atmid][fATMPosRot]); new text[40]; format(text,sizeof(text),""COL_GENERAL"[ATM ID: "COL_WHITE"%d"COL_GENERAL"]\n"COL_WHITE"Ingresa tu tarjeta usando '/atm'.",atmid); DestroyDynamic3DTextLabel(Text3D:atmVariables[atmid][rTextLabel]); atmVariables[atmid][rTextLabel] = CreateDynamic3DTextLabel(text,COLOR_GRAD1,atmVaria bles[atmid][fATMPos][0],atmVariables[atmid][fATMPos][1],atmVariables[atmid][fATMPos][2],8.0); atmVariables[atmid][atmMoney] = 0; SendClientMessageEx(playerid, COLOR_WHITE, "Creaste satisfactoriamente el ATM indicado."); atmSave(); } else return SendClientMessageEx(playerid, COLOR_GREY, "USA: /crearatm [ID Libre]!"); return 1; } |