31.08.2013, 09:43
Код:
CMD:goto(playerid, params[]) { new stringa[256]; tmp = strtok2(cmdtext, idx); new utente = ReturnUser(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, 0xbbff0000 , "{FFF000}USE: {BBFF00}/goto {FFFFFF}(playerid)"); return 1; } if(!IsPlayerConnected(utente)) return SendClientMessage(playerid, 0xFFFFFFF, "{FF0000}Player {FFFFFF}not connected!"); if(utente == playerid) return SendClientMessage(playerid, 0xFFFFFFF, "{FF0000}You cannot {FFFFFF}/goto yourself!"); new Float:x, Float:y, Float:z; new nome[MAX_PLAYER_NAME]; GetPlayerName(utente, nome, sizeof(nome)); GetPlayerPos(utente, x, y, z); SetPlayerPos(playerid, x, y, z+1); format(stringa, sizeof(stringa), "You have {BBFF00}teleported {FFF000}to {FFFFFF}%s(ID:%d)", nome, utente); SendClientMessage(playerid, 0xFFF000 , stringa); return 1; } new tmp[32]; new cmd[256], idx; cmd = strtok(cmdtext, idx); CMD:v(playerid, params[]) tmp = strtok2(cmdtext, idx); if(!strlen(tmp) || strlen(tmp) > 32) {return SendClientMessage(playerid, ARANCIONE, "USE{FFFFFF}: {F2FF00}/v (namecar)"); } new veicolo; if(!IsNumeric(tmp)) { veicolo = GetVehicleModelIDFromName(tmp); } else { veicolo = strval(tmp); } if(veicolo > 611 || veicolo < 400) { return SendClientMessage(playerid, ARANCIONE, "{FF0000}ID {FFFFFF}or {FF0000}Name Vehicle {FFFFFF}Invalid"); } if(veicolo == 432) return SendClientMessage(playerid,0xFF0000FF,"You can't spawn Rhino!"); if(CreaVeicolo[playerid] != -1) { DestroyVehicle(CreaVeicolo[playerid]); } new Float:pos[4]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); GetPlayerFacingAngle(playerid, pos[3]); CreaVeicolo[playerid] = CreateVehicle(veicolo, pos[0], pos[1], pos[2], pos[3], -1, -1, 50000); PutPlayerInVehicle(playerid, CreaVeicolo[playerid], 0); new Giocatori = GetMaxPlayers(); for(new i; i < Giocatori; i++) { if(!IsPlayerConnected(i) || i == playerid) continue; SetVehicleParamsForPlayer(CreaVeicolo[playerid], i, 0, true); } new stringa[144]; format(stringa, sizeof stringa, "{FFFFFF}[SYSTEM]: {0099FF}Vehicle: {FF9900}%s. {FFFFFF}Status: {5CD822}Spawned!", NomiVeicoli[veicolo-400]); SendClientMessage(playerid, BLU, stringa); return 1; } //////THIS WORK////// CMD:vehicles(playerid, params[]) { if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { #if !defined IGNORA_CANCELLAZIONE_VEICOLO MostraDialogoPredefinito( playerid ); GetPlayerInterior(playerid); return 1; #endif } if ( GetPlayerState(playerid) != PLAYER_STATE_PASSENGER) MostraDialogoPredefinito(playerid); return 1; }